From 11e99a0b53fe6c5f9dd04c22d4cb9b800cbb2f1d Mon Sep 17 00:00:00 2001 From: Nicolas Martinelli Date: Fri, 13 Jan 2017 11:14:03 +0100 Subject: [PATCH] [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. --- addons/product_extended/models/product.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/product_extended/models/product.py b/addons/product_extended/models/product.py index 97d6f34b637..5a785118891 100644 --- a/addons/product_extended/models/product.py +++ b/addons/product_extended/models/product.py @@ -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