[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:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user