Convert cost price into move uom to compute average cost price

The unit price is always expressed in the unit of the move but the cost price
is computed in the default uom.

issue7918
review251121002
This commit is contained in:
Cédric Krier
2019-03-22 11:16:13 +01:00
parent 141029e64d
commit 76a034f4ce
+2 -1
View File
@@ -73,7 +73,8 @@ class Move(metaclass=PoolMeta):
# Compute average cost price
unit_price = self.unit_price
self.unit_price = cost_price
self.unit_price = Uom.compute_price(
move.product.default_uom, cost_price, self.uom)
average_cost_price = self._compute_product_cost_price('out')
self.unit_price = unit_price