Skip to content

Commit

Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[FIX] account_invoice_triple_discount: remove digits on overloaded fi…
Browse files Browse the repository at this point in the history
…eld 'discount' as the field is now a technical field that should not have limitation. For exemple in the default case where digits precision of Discount is 2, if discounts are 05%, 09% and 13% the main discount is 24.7885 % (and not 24.79)
legalsylvain committed Nov 14, 2024

Unverified

This commit is not signed, but one or more authors requires that any commit attributed to them is signed.
1 parent 37c8e08 commit 62d5d3f
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions account_invoice_triple_discount/models/account_move_line.py
Original file line number Diff line number Diff line change
@@ -11,11 +11,18 @@ class AccountMoveLine(models.Model):

_inherit = "account.move.line"

# core discount field is now a computed field
# based on the 3 discounts defined below.
# the digits limitation is removed, to make
# the computation of the subtotal exact.
# For exemple, if discounts are 05%, 09% and 13%
# the main discount is 24.7885 % (and not 24.79)
discount = fields.Float(
string="Total discount",
compute="_compute_discount",
store=True,
readonly=True,
digits=None,
)
discount1 = fields.Float(
string="Discount 1 (%)",

0 comments on commit 62d5d3f

Please sign in to comment.