Skip to content

[19.0][FIX] sale_global_discount: discount amounts on orders without …#4241

Merged
OCA-git-bot merged 1 commit intoOCA:19.0from
Studio73:19.0-sale_global_discount
Apr 9, 2026
Merged

[19.0][FIX] sale_global_discount: discount amounts on orders without …#4241
OCA-git-bot merged 1 commit intoOCA:19.0from
Studio73:19.0-sale_global_discount

Conversation

@adrip-s73
Copy link
Copy Markdown
Contributor

When modifying quantities on a confirmed order that has no global discounts, the fields amount_untaxed_before_global_discounts and amount_total_before_global_discounts were not being updated.

The _compute_amounts method used an early continue when global_discount_ids was empty, leaving those compute fields unassigned and retaining stale data in the cache/database.

Explicitly assign the standard untaxed and total amounts to the "before discount" fields, and set the global discount amount to 0.0 before continuing the loop.

image

@rousseldenis rousseldenis added this to the 19.0 milestone Mar 31, 2026
Copy link
Copy Markdown
Contributor

@rousseldenis rousseldenis left a comment

Choose a reason for hiding this comment

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

Seems legit

Copy link
Copy Markdown
Member

@ioans73 ioans73 left a comment

Choose a reason for hiding this comment

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

LGTM

@OCA-git-bot
Copy link
Copy Markdown
Contributor

This PR has the approved label and has been created more than 5 days ago. It should therefore be ready to merge by a maintainer (or a PSC member if the concerned addon has no declared maintainer). 🤖

@rousseldenis
Copy link
Copy Markdown
Contributor

/ocabot merge patch

@OCA-git-bot
Copy link
Copy Markdown
Contributor

This PR looks fantastic, let's merge it!
Prepared branch 19.0-ocabot-merge-pr-4241-by-rousseldenis-bump-patch, awaiting test results.

@OCA-git-bot OCA-git-bot merged commit e2a0d25 into OCA:19.0 Apr 9, 2026
7 checks passed
@OCA-git-bot
Copy link
Copy Markdown
Contributor

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

4 participants