From 76a034f4ce6ef4fa2e6b02eb7f2b3aa02c4751d0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric=20Krier?= Date: Fri, 22 Mar 2019 11:16:13 +0100 Subject: [PATCH] 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 --- move.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/move.py b/move.py index 94fae9b277..ccee0b4db9 100644 --- a/move.py +++ b/move.py @@ -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