Skip to content
Snippets Groups Projects
Commit 9a7ed7ca authored by Nicolas Martinelli's avatar Nicolas Martinelli
Browse files

[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
parent 61a9cdc3
No related branches found
No related tags found
No related merge requests found
......@@ -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
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment