Skip to content

[ADD] sale: Auto-recalculate global discount on order line changes #881

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

arkp-odoo
Copy link

@arkp-odoo arkp-odoo commented Jul 24, 2025

Before:

  • Global discount remained unchanged even after modifying, deleting, or adding sale order lines.
  • Discount lines were not automatically removed when no product lines existed.
    -This could result in incorrect order totals or stale discount values, requiring manual updates.

After:

  • Global discount is now automatically recalculated whenever sale order lines are changed.
  • Discount line is removed if all product lines are deleted.

Impact:
-Ensures consistent and accurate pricing aligned with the current order state.
-Ensures accurate and reliable order totals.

task-4962389

@robodoo
Copy link

robodoo commented Jul 24, 2025

Pull request status dashboard

Copy link

@maad-odoo maad-odoo left a comment

Choose a reason for hiding this comment

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

The PR and commit title is not right.
As a new module is being added, it should be [ADD] instead of [IMP]
Please follow the coding guidelines 🙏
Missing task id reference

@arkp-odoo arkp-odoo changed the title [IMP] sale: Auto-recalculate global discount on order line changes [ADD] sale: Auto-recalculate global discount on order line changes Jul 29, 2025
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.

task-4962389
@arkp-odoo arkp-odoo force-pushed the 18.0-discount-update-arkp branch from 87ea320 to d5a583e Compare July 29, 2025 12:26
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.

3 participants