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