From 119ca24d60f244927d6d2d987fd2072eaad46870 Mon Sep 17 00:00:00 2001 From: Nans Lefebvre Date: Mon, 12 Aug 2019 13:49:02 +0000 Subject: [PATCH] [FIX] account: fix invoice line default taxes at account onchange If there is no product on an invoice line, there is an onchange to ease tax input that prefills the line with the account default taxes. Because this is a relational field (a many2many), field = recordset is as valid as field = recordset.ids, but the semantics is different. In the second case, the id list is added with 4 commands, not a 6. So the default taxes are only added, and none are ever removed. Note that the ORM behaviour changed; this .ids was historical, but before (v10) it did remove other taxes. opw 2046112 closes odoo/odoo#35657 Signed-off-by: Nans Lefebvre (len) --- addons/account/models/account_invoice.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/account/models/account_invoice.py b/addons/account/models/account_invoice.py index 0f42739e899..c22a2beb56b 100644 --- a/addons/account/models/account_invoice.py +++ b/addons/account/models/account_invoice.py @@ -1657,7 +1657,7 @@ class AccountInvoiceLine(models.Model): return if not self.product_id: fpos = self.invoice_id.fiscal_position_id - self.invoice_line_tax_ids = fpos.map_tax(self.account_id.tax_ids, partner=self.partner_id).ids + self.invoice_line_tax_ids = fpos.map_tax(self.account_id.tax_ids, partner=self.partner_id) elif not self.price_unit: self._set_taxes()