[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) <len@odoo.com>
This commit is contained in:
Nans Lefebvre
2019-08-12 13:49:08 +00:00
parent b59369d1e6
commit 119ca24d60
+1 -1
View File
@@ -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()