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

[17.0][FIX] sale_fixed_discount: SOL discount propagation to invoice line #3150

Merged
merged 1 commit into from
Jun 24, 2024

Conversation

astirpe
Copy link
Member

@astirpe astirpe commented May 25, 2024

Context:
when creating or editing a sale order line by using the UI, the _onchange_discount_fixed() ensures that the discount field is computed based on the value of discount_fixed and price_unit fields. Keeping the discount updated is important because this value will be propagated to the invoice line at the moment the invoice is generated.

Description of the issue:
The onchange method is not triggered in case we create or modify the sale order line by using an API (and so without using the UI) or when we update discount_fixed and price_unit field in custom code.
This means that the wrong discount value (that stays 0.0) will be propagated to the invoice line at the moment the invoice is generated.

Proposed fix:
with this PR the onchange method is replaced by extending the _compute_discount() method, ensuring that the discount field is consistent with discount_fixed

@astirpe astirpe marked this pull request as ready for review May 25, 2024 09:11
Copy link

@CasVissers-360ERP CasVissers-360ERP left a comment

Choose a reason for hiding this comment

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

Functional review

@astirpe
Copy link
Member Author

astirpe commented Jun 4, 2024

Can this one be merged?

@astirpe astirpe force-pushed the 17_fix_sale_fixed_discount branch from fe0bfd9 to c73fbd4 Compare June 23, 2024 20:48
@rousseldenis
Copy link
Sponsor Contributor

/ocabot merge major

@OCA-git-bot
Copy link
Contributor

What a great day to merge this nice PR. Let's do it!
Prepared branch 17.0-ocabot-merge-pr-3150-by-rousseldenis-bump-major, awaiting test results.

@OCA-git-bot OCA-git-bot merged commit 86fc1df into OCA:17.0 Jun 24, 2024
6 of 7 checks passed
@OCA-git-bot
Copy link
Contributor

Congratulations, your PR was merged at 264a80d. 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.

None yet

5 participants