changeset 96d9be7eb3a1 in modules/product_cost_fifo:5.0
details:
https://hg.tryton.org/modules/product_cost_fifo?cmd=changeset;node=96d9be7eb3a1
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 b4a800625d8a -r 96d9be7eb3a1 move.py
--- a/move.py Tue Feb 19 22:05:00 2019 +0100
+++ b/move.py Fri Mar 22 11:16:13 2019 +0100
@@ -74,7 +74,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