From 907034b1f6e3daf146d5be35b2cf1b4cc1ed7e6f Mon Sep 17 00:00:00 2001 From: Pierre Masereel Date: Thu, 23 Feb 2017 10:17:53 +0100 Subject: [PATCH] [FIX] mrp_repair: map_tax missing attributes When the function map_tax is called on the fiscal position in repair lines to compute taxes, the partner and product are not passed to the method which leads to mistakes when the module account_taxcloud tries to get back the taxes for the specific partner and tic_category of the product. To fix the issue, we pass the product and partner that we already have to the function map_tax. --- addons/mrp_repair/models/mrp_repair.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/addons/mrp_repair/models/mrp_repair.py b/addons/mrp_repair/models/mrp_repair.py index db253930864..18c3bee3463 100644 --- a/addons/mrp_repair/models/mrp_repair.py +++ b/addons/mrp_repair/models/mrp_repair.py @@ -488,7 +488,7 @@ class RepairLine(models.Model): if not self.product_id or not self.product_uom_qty: return if partner and self.product_id: - self.tax_id = partner.property_account_position_id.map_tax(self.product_id.taxes_id).ids + self.tax_id = partner.property_account_position_id.map_tax(self.product_id.taxes_id, self.product_id, partner).ids if self.product_id: self.name = self.product_id.display_name self.product_uom = self.product_id.uom_id.id @@ -550,7 +550,7 @@ class RepairFee(models.Model): pricelist = self.repair_id.pricelist_id if partner and self.product_id: - self.tax_id = partner.property_account_position_id.map_tax(self.product_id.taxes_id).ids + self.tax_id = partner.property_account_position_id.map_tax(self.product_id.taxes_id, self.product_id, partner).ids if self.product_id: self.name = self.product_id.display_name self.product_uom = self.product_id.uom_id.id