From 62d5d3f4b44a5cc603dda1028c333a4a2ca208b3 Mon Sep 17 00:00:00 2001 From: Sylvain LE GAL Date: Thu, 14 Nov 2024 11:35:19 +0100 Subject: [PATCH] [FIX] account_invoice_triple_discount: remove digits on overloaded field '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) --- .../models/account_move_line.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/account_invoice_triple_discount/models/account_move_line.py b/account_invoice_triple_discount/models/account_move_line.py index 452f150de16..ee469dabee4 100644 --- a/account_invoice_triple_discount/models/account_move_line.py +++ b/account_invoice_triple_discount/models/account_move_line.py @@ -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 (%)",