changeset 7d285b9f991c in modules/product_cost_fifo:4.8
details:
https://hg.tryton.org/modules/product_cost_fifo?cmd=changeset;node=7d285b9f991c
description:
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
(grafted from 0e32a0ae4a163e30d3d643625fc979e896ac7b51)
diffstat:
move.py | 3 ++-
1 files changed, 2 insertions(+), 1 deletions(-)
diffs (13 lines):
diff -r 77216c0dd703 -r 7d285b9f991c move.py
--- a/move.py Tue Feb 19 22:52:48 2019 +0100
+++ b/move.py Fri Mar 22 11:16:13 2019 +0100
@@ -75,7 +75,8 @@
# 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