Skip to content

[18.0][FIX] sale_global_discount: discount amounts with round_globally rounding method - #4557

Open
LorenzoC0 wants to merge 1 commit into
OCA:18.0from
LorenzoC0:18.0-fix-sale_global_discount-rounding
Open

[18.0][FIX] sale_global_discount: discount amounts with round_globally rounding method#4557
LorenzoC0 wants to merge 1 commit into
OCA:18.0from
LorenzoC0:18.0-fix-sale_global_discount-rounding

Conversation

@LorenzoC0

Copy link
Copy Markdown

This patch disables the calculation of global discount amounts if none is selected and computes discount amounts consistently from per-line subtotals instead of mixing them with globally rounded order totals.

You can trigger a -0,01€ discount without any global discount selected (or a global discount set to 0%) with these steps:

  1. Create a sales order.
  2. Set the unit price precision to 3 decimal places.
  3. In the sales order, create 4 lines:
    • Product 1 - qty 3 - unit price 3.460;
    • Product 2 - qty 1 - unit price 25,000;
    • Product 3 - qty 6 - unit price 4,713;
    • Product 4 - qty 6 - unit price 4,501.
  4. Do not set a global discount.
  5. Check the amount of the global discount applied.

@OCA-git-bot OCA-git-bot added series:18.0 mod:sale_global_discount Module sale_global_discount labels Aug 31, 2026
@LorenzoC0 LorenzoC0 changed the title [FIX] sale_global_discount: discount amounts with round_globally rounding method [18.0][FIX] sale_global_discount: discount amounts with round_globally rounding method Aug 31, 2026
@LorenzoC0
LorenzoC0 force-pushed the 18.0-fix-sale_global_discount-rounding branch from cc8a9a1 to 09a5c88 Compare August 31, 2026 13:35
Comment thread sale_global_discount/models/sale_order.py
@LorenzoC0
LorenzoC0 force-pushed the 18.0-fix-sale_global_discount-rounding branch from 09a5c88 to d989819 Compare September 2, 2026 10:27

@eLBati eLBati left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Thanks

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

Labels

mod:sale_global_discount Module sale_global_discount series:18.0

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants