From 9a7ed7cabd998559f8c4ae71c80d83775906244a Mon Sep 17 00:00:00 2001 From: Nicolas Martinelli Date: Fri, 1 Jul 2016 11:05:28 +0200 Subject: [PATCH] [FIX] sale_mrp: COGS in case of kit When a kit is sold, the unit price of the COGS recorded is the sum of the unit prices of each component multiplies by the quantity sold. Obviously, this is not correct since the unit price should not take into account the quantity sold. opw-681403 --- 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 c168e0e1770..da0bd383187 100644 --- a/addons/sale_mrp/sale_mrp.py +++ b/addons/sale_mrp/sale_mrp.py @@ -141,7 +141,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 += factor * self._compute_average_price(prod_qty_done, prod_quantity, prod_moves) + average_price_unit += self._compute_average_price(prod_qty_done, prod_quantity, prod_moves) price_unit = average_price_unit or price_unit price_unit = uom_obj._compute_qty_obj(self.uom_id, price_unit, self.product_id.uom_id, round=False) return price_unit