From 4d1bf67dd35c39071e6789221672f8a9fb20e8ba Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric=20Krier?= Date: Fri, 8 May 2015 14:58:36 +0200 Subject: [PATCH] Write shipment cost on moves at once issue4728 review7121002 --- stock.py | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/stock.py b/stock.py index 256f61ffd8..f9b2c6c463 100644 --- a/stock.py +++ b/stock.py @@ -119,10 +119,9 @@ class ShipmentIn: move.currency, round=False) unit_shipment_cost = unit_shipment_cost.quantize( exp, rounding=ROUND_HALF_EVEN) - Move.write([move], { - 'unit_price': move.unit_price + unit_shipment_cost, - 'unit_shipment_cost': unit_shipment_cost, - }) + move.unit_price += unit_shipment_cost + move.unit_shipment_cost = unit_shipment_cost + Move.save(moves) @classmethod @ModelView.button