[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.
This commit is contained in:
Pierre Masereel
2017-02-24 10:43:14 +01:00
parent 95038f0bf3
commit 907034b1f6
+2 -2
View File
@@ -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