From 88a12afdf4bcd5b2b170f66c024e465bc8d3aad3 Mon Sep 17 00:00:00 2001 From: Goffin Simon Date: Mon, 8 Jul 2019 12:09:51 +0000 Subject: [PATCH] [FIX] purchase: purchase VATs in a multi-company Steps to reproduce the bug: - Create two companies C1 and C2 where C2 is the child of C1 - Create two purchase taxes T1 and T2 where T1 is in C1 and C2 is in T2 - Create a prodcuct P with T1 and T2 as supplier taxes - Be in C1 as current company - Create a RFQ and add P Bug: T1 and T2 were set on the order line of P instead of T1 PS: This fix is insired from product_id_change in model sale.order.line opw:2032113 closes odoo/odoo#34658 Signed-off-by: Simon Goffin (sig) --- addons/purchase/models/purchase.py | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/addons/purchase/models/purchase.py b/addons/purchase/models/purchase.py index e44f177afad..99e45f5b4b3 100644 --- a/addons/purchase/models/purchase.py +++ b/addons/purchase/models/purchase.py @@ -577,12 +577,7 @@ class PurchaseOrderLine(models.Model): if product_lang.description_purchase: self.name += '\n' + product_lang.description_purchase - fpos = self.order_id.fiscal_position_id - if self.env.uid == SUPERUSER_ID: - company_id = self.env.user.company_id.id - self.taxes_id = fpos.map_tax(self.product_id.supplier_taxes_id.filtered(lambda r: r.company_id.id == company_id)) - else: - self.taxes_id = fpos.map_tax(self.product_id.supplier_taxes_id) + self._compute_tax_id() self._suggest_quantity() self._onchange_quantity()