diff options
| author | Goffin Simon <sig@odoo.com> | 2019-07-08 12:09:51 +0000 |
|---|---|---|
| committer | Goffin Simon <sig@odoo.com> | 2019-07-08 12:09:51 +0000 |
| commit | 88a12afdf4bcd5b2b170f66c024e465bc8d3aad3 (patch) | |
| tree | e57484e71afd0d6446fcbf7b3d84dd92d1fcfc40 | |
| parent | a3e504eff521844d36dd931a3ed22f8d86b95153 (diff) | |
[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) <sig@openerp.com>
| -rw-r--r-- | addons/purchase/models/purchase.py | 7 |
1 files changed, 1 insertions, 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() |
