Skip to content
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

[FIX] account_move_tier_validation: do not overwrite line values #1880

Open
wants to merge 1 commit into
base: 17.0
Choose a base branch
from

Conversation

len-foss
Copy link

Edit a new journal entry with lines in currency X different from company currency Y. Say you have a line of value (amount_currency) N, which is converted to Y(N) (debit/credit). Then amount_total is also N. Because the readonly="not(review_ids)" was added, amount_total is dirty and sent at save. Therefore, Odoo uses it and sets the debit/credit values of the lines to N (instead of Y(N), the converted value). It's as if it's ignoring the currency conversion (note that the values are correct through onchange before the save).

To avoid this, exclude the field from being modified in get_view.

Edit a new journal entry with lines in currency X different from company currency Y.
Say you have a line of value (amount_currency) N, which is converted to Y(N) (debit/credit).
Then `amount_total` is also N. Because the `readonly="not(review_ids)"` was added, `amount_total` is dirty and sent at save.
Therefore, Odoo uses it and sets the debit/credit values of the lines to N (instead of Y(N), the converted value).
It's as if it's ignoring the currency conversion (note that the values are correct through onchange before the save).

To avoid this, exclude the field from being modified in `get_view`.
@len-foss
Copy link
Author

It looks like the branch is borked? It's module account_invoice_section_sale_order that fails before the tests are run for the modified module.

Copy link
Member

@StefanRijnhart StefanRijnhart left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, makes sense!
Tests of this module are running fine, but indeed those of account_invoice_section_sale_order are broken because of odoo/odoo@1443e5503c7396512a. A fix is already proposed in #1871.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants