changeset 9e5f8c478c2b in modules/purchase_shipment_cost:5.2
details:
https://hg.tryton.org/modules/purchase_shipment_cost?cmd=changeset;node=9e5f8c478c2b
description:
Convert shipment cost into default uom
issue9188
review256871002
(grafted from 938f26a29b4026d40f1e615abfbd4eda3de18229)
diffstat:
stock.py | 5 ++++-
1 files changed, 4 insertions(+), 1 deletions(-)
diffs (19 lines):
diff -r c11360491574 -r 9e5f8c478c2b stock.py
--- a/stock.py Sat Apr 04 17:13:44 2020 +0200
+++ b/stock.py Mon Apr 13 17:18:28 2020 +0200
@@ -178,11 +178,14 @@
def _get_anglo_saxon_move(cls, moves, quantity, type_):
pool = Pool()
Currency = pool.get('currency.currency')
+ Uom = pool.get('product.uom')
for move, qty, cost_price in super(Move, cls)._get_anglo_saxon_move(
moves, quantity, type_):
if (type_.startswith('in_')
and move.unit_shipment_cost):
+ shipment_cost = Uom.compute_price(move.uom,
+ move.unit_shipment_cost, move.product.default_uom)
shipment_cost = Currency.compute(move.currency,
- move.unit_shipment_cost, move.company.currency)
+ shipment_cost, move.company.currency)
cost_price -= shipment_cost
yield move, qty, cost_price