From 28b4efb8ab2104e1bb3fa355bfa6b2a5c40ef981 Mon Sep 17 00:00:00 2001 From: Guillem Barba Date: Mon, 5 Oct 2015 11:58:46 +0200 Subject: [PATCH] Improve patch to fix rounding in inventory_to_outgoing --- ...ounding_in_sync_inventory_to_outgoing.patch | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) diff --git a/fix_rounding_in_sync_inventory_to_outgoing.patch b/fix_rounding_in_sync_inventory_to_outgoing.patch index 56e19e8..4d6e55e 100644 --- a/fix_rounding_in_sync_inventory_to_outgoing.patch +++ b/fix_rounding_in_sync_inventory_to_outgoing.patch @@ -1,7 +1,7 @@ diff -r fdfe606e6b87 stock.py --- a/trytond/trytond/modules/stock_lot/stock.py Thu Feb 19 00:04:21 2015 +0100 -+++ b/trytond/trytond/modules/stock_lot/stock.py Mon Oct 05 11:26:49 2015 +0200 -@@ -119,7 +119,9 @@ ++++ b/trytond/trytond/modules/stock_lot/stock.py Mon Oct 05 11:56:24 2015 +0200 +@@ -119,16 +119,19 @@ round=False) if quantity < out_quantity: outgoing_moves.extend(Move.copy([out_move], default={ @@ -11,4 +11,16 @@ diff -r fdfe606e6b87 stock.py + out_move.uom.rounding), })) Move.write([out_move], { - 'quantity': quantity, +- 'quantity': quantity, ++ 'quantity': Uom.round( ++ quantity, out_move.uom.rounding), + }) + Move.write([out_move], { + 'lot': move.lot.id, + }) + quantity -= out_quantity +- assert quantity <= 0 ++ assert quantity <= move.product.default_uom.rounding + + + class ShipmentOutReturn: