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

[16.0][FIX] account_avatax_sale_oca: Avoid reset of order line price after saving #442

Merged
merged 2 commits into from
Jul 15, 2024

Conversation

JordiBForgeFlow
Copy link
Member

We found a bug where the price when the decimal accuracy was 5, the price would be automatically reset to the pricelist price after saving the order. The reason was a wrong implementation of onchange_reset_avatax_amount. In this test we demonstrate that the error does not happen anymore.

The PR contains 2 commits:

  • Commit 1 contains a test that reproduces the error
  • Commit 2 contains the fix, and the test implemented in previous commit now passes

We found a bug where the price when the decimal accuracy was 5,
the price would be automatically reset to the pricelist price after
saving the order. The reason was a wrong implementation of
onchange_reset_avatax_amount. In this test we demonstrate that
the error does not happen anymore.
@OCA-git-bot
Copy link
Contributor

Hi @dreispt,
some modules you are maintaining are being modified, check this out!

We have observed that when we change the Product Unit of Measure to 5 decimals,
and we have a pricelist in the product, when the price is manually set by the
user and the order is saved, the price is reset to the product pricelist price.
The reason is that the change made to order_line during the onchange_reset_avatax_amount
in the sale.order.

In order to fix this, we do not change the order_line during the onchange_reset_avatax_amount
in sale.order, but at the time of saving, in the write method.
@JordiBForgeFlow
Copy link
Member Author

@JordiBForgeFlow
Copy link
Member Author

See how after the second commit the tests now pass.

@dreispt
Copy link
Member

dreispt commented Jul 15, 2024

/ocabot merge patch

@OCA-git-bot
Copy link
Contributor

What a great day to merge this nice PR. Let's do it!
Prepared branch 16.0-ocabot-merge-pr-442-by-dreispt-bump-patch, awaiting test results.

@OCA-git-bot OCA-git-bot merged commit ff55de4 into OCA:16.0 Jul 15, 2024
7 checks passed
@OCA-git-bot
Copy link
Contributor

Congratulations, your PR was merged at c486aa5. Thanks a lot for contributing to OCA. ❤️

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

Successfully merging this pull request may close these issues.

3 participants