From 747083ae652e35b48d9030f5b5b346cf610a6031 Mon Sep 17 00:00:00 2001 From: eLBati Date: Tue, 31 Oct 2023 07:19:35 +0100 Subject: [PATCH] FIX account_invoice_triple_discount - _recompute_tax_lines involving only relevant lines: invoice_line_ids --- account_invoice_triple_discount/models/account_move.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/account_invoice_triple_discount/models/account_move.py b/account_invoice_triple_discount/models/account_move.py index 89237317e44..20042c73161 100644 --- a/account_invoice_triple_discount/models/account_move.py +++ b/account_invoice_triple_discount/models/account_move.py @@ -16,9 +16,9 @@ def _recompute_tax_lines(self, **kwargs): restored after the original process is done """ old_values_by_line_id = {} - digits = self.line_ids._fields["price_unit"]._digits - self.line_ids._fields["price_unit"]._digits = (16, 16) - for line in self.line_ids: + digits = self.invoice_line_ids._fields["price_unit"]._digits + self.invoice_line_ids._fields["price_unit"]._digits = (16, 16) + for line in self.invoice_line_ids: aggregated_discount = line._compute_aggregated_discount(line.discount) old_values_by_line_id[line.id] = { "price_unit": line.price_unit, @@ -26,9 +26,9 @@ def _recompute_tax_lines(self, **kwargs): } price_unit = line.price_unit * (1 - aggregated_discount / 100) line.update({"price_unit": price_unit, "discount": 0}) - self.line_ids._fields["price_unit"]._digits = digits + self.invoice_line_ids._fields["price_unit"]._digits = digits res = super(AccountMove, self)._recompute_tax_lines(**kwargs) - for line in self.line_ids: + for line in self.invoice_line_ids: if line.id not in old_values_by_line_id: continue line.update(old_values_by_line_id[line.id])