Skip to content

[IMP] sale: Auto-recalculate global discount on order line changes #882

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

Draft
wants to merge 1 commit into
base: 18.0
Choose a base branch
from

Conversation

niyp-odoo
Copy link

The global discount on a Sales Order must always reflect the actual value of product lines to prevent discrepancies in final pricing. Previously, changes to order lines (such as additions, edits, or deletions) could leave the global discount outdated or inconsistent. This posed a risk of incorrect totals and manual corrections.

By ensuring the discount dynamically adjusts to the current state of the order lines, we improve reliability in pricing, reduce manual errors, and maintain alignment with business expectations for automated discount handling.

Enhanced the Sales Order logic to automatically recalculate and update the
global discount line whenever sale order lines are added, updated, or deleted.
This ensures that the discount remains in sync with the current order total.
If all product lines are removed, the discount line is also removed.
This improves data consistency and reduces the need for manual discount updates.
@robodoo
Copy link

robodoo commented Jul 24, 2025

Pull request status dashboard

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