From f1fdb97eed377951eb680049522dc02df445ee32 Mon Sep 17 00:00:00 2001 From: Pierre Masereel Date: Tue, 19 Dec 2017 15:15:26 +0100 Subject: [PATCH] [FIX] mrp_sale: compute unit price of kit When the unit price of a kit is computed in anglo saxon accounting, the average price of kit parts is not multiplied by the quantity of this parts in the bom. E.g.: a kit of 2 prod1 and 1 prod2, when the price is computed, it only take into account the cost of 1 prod1 and 1 prod2 to compute the kit cost instead of 2 prod1 and 1 prod2 opw-786268 --- addons/sale_mrp/sale_mrp.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/sale_mrp/sale_mrp.py b/addons/sale_mrp/sale_mrp.py index bd4bc2ecfb8..d4b7ec04e75 100644 --- a/addons/sale_mrp/sale_mrp.py +++ b/addons/sale_mrp/sale_mrp.py @@ -111,7 +111,7 @@ class AccountInvoiceLine(models.Model): prod_moves = [m for m in moves if m.product_id.id == product_id] prod_qty_done = factor * qty_done prod_quantity = factor * quantity - average_price_unit += self._compute_average_price(prod_qty_done, prod_quantity, prod_moves) + average_price_unit += factor * self._compute_average_price(prod_qty_done, prod_quantity, prod_moves) price_unit = average_price_unit or price_unit price_unit = self.product_id.uom_id._compute_price(price_unit, self.uom_id) return price_unit