From c88eebba5df6c4fd7482563ffd9493aa205a1ff5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric=20Krier?= Date: Tue, 10 May 2011 15:03:54 +0200 Subject: [PATCH] Add missing rounding in creation of move of inventory for issue2007 --- inventory.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/inventory.py b/inventory.py index ceeb1dfa03..518290d9ad 100644 --- a/inventory.py +++ b/inventory.py @@ -263,7 +263,11 @@ class InventoryLine(ModelSQL, ModelView): :return: the stock.move id or None ''' move_obj = self.pool.get('stock.move') - delta_qty = line.expected_quantity - line.quantity + uom_obj = self.pool.get('product.uom') + + delta_qty = uom_obj.compute_qty(line.uom, + line.expected_quantity - line.quantity, + line.uom) if delta_qty == 0.0: return from_location = line.inventory.location.id