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])