-
Notifications
You must be signed in to change notification settings - Fork 289
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[IMP] internal_transfer_with_agreed_amount: modify write vals in one method i#24002 #1631
[IMP] internal_transfer_with_agreed_amount: modify write vals in one method i#24002 #1631
Conversation
2cd1258
to
3e8fc96
Compare
@rolandojduartem could you review, please? |
vals = {"debit": line.debit} if line.amount_currency > 0 else {"credit": line.credit} | ||
sign = 1 if line.amount_currency > 0 else -1 | ||
vals.update({"amount_currency": sign * self.agreed_amount, "currency_id": currency.id}) | ||
return vals | ||
|
||
def _postprocessing_payment_with_aggred_amount(self, payment): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
def _postprocessing_payment_with_aggred_amount(self, payment): | |
def _postprocessing_payment_with_agreed_amount(self, payment): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed.
vals = self._prepare_values_from_lines(debit, is_same_company_currency=True) | ||
debit.with_context(check_move_validity=False).write(vals) | ||
vals = self._prepare_values_from_lines(credit, is_same_company_currency=True) | ||
credit.with_context(check_move_validity=False).write(vals) | ||
amls.move_id.action_post() | ||
to_reconcile.reconcile() | ||
return |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry, you have to call the method before the return too self._postprocessing_payment_with_agreed_amount(payment)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added.
3e8fc96
to
f08b8d4
Compare
@rolandojduartem could you review again, please? |
0782a2b
to
207c450
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM 👍 please, @luisg123v, could you review it?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
By reading commit message, it's not clear why the change, there's only a changelog.
internal_transfer_with_agreed_amount/wizards/internal_transfer_multicurrency.py
Outdated
Show resolved
Hide resolved
internal_transfer_with_agreed_amount/wizards/internal_transfer_multicurrency.py
Outdated
Show resolved
Hide resolved
Missing task ID on MR title |
207c450
to
79e19c7
Compare
Since it's related to a ticket, I added the ticket ID on the title. |
@luisg123v could you review again, please? |
79e19c7
to
c88971d
Compare
…method Modify in a single method the values that will be written in the account move lines so that the method can be inherited in case it is necessary to modify more values in the lines. In addition, two methods are added to pre and post process payments, to be used if modifications are required in an inheritance. Finally, obtaining currencies related to the internal transfer have been moved to a separate method to facilitate the inheritance of the method that validates the number of currencies. Changelog: - Set debit and credit values to write in _prepare_values_from_lines method when the exchange currency is the same as the company currency. - Add methods to be inherited when payments also needs modifications. - Get the currencies in a new method named _get_currencies.
c88971d
to
7bda48e
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM 👍
Modify in a single method the values that will be written in the account
move lines so that the method can be inherited in case it is necessary
to modify more values in the lines.
In addition, two methods are added to pre and post process payments, to
be used if modifications are required in an inheritance.
Finally, obtaining currencies related to the internal transfer have been
moved to a separate method to facilitate the inheritance of the method
that validates the number of currencies.
Changelog:
method when the exchange currency is the same as the company currency.