[FIX] product_extended: compute from BoM

When a product template UoM is different from its BoM UoM, the price
suggested thanks to the "Compute from BoM" is incorrect, since it doesn't
apply the conversion rate between the product template UoM and the BoM UoM.

This is because we try to fetch the product UoM through the BoM. However,
if the BoM is not specific to a product.product, the field bom.product_id
is empty.
This commit is contained in:
Nicolas Martinelli
2017-01-13 13:25:00 +01:00
parent 3609782481
commit 11e99a0b53
+1 -1
View File
@@ -49,5 +49,5 @@ class ProductProduct(models.Model):
price += bom.product_uom_id._compute_price(workcenter_cost, bom.product_id.uom_id)
# Convert on product UoM quantities
if price > 0:
price = bom.product_uom_id._compute_price(price / bom.product_qty, bom.product_id.uom_id)
price = bom.product_uom_id._compute_price(price / bom.product_qty, self.uom_id)
return price