From 69ae155fa4deb631504fe8bad09ba8e5f9c379f3 Mon Sep 17 00:00:00 2001 From: Karla Stenger Date: Mon, 11 Jan 2016 10:30:50 -0300 Subject: [PATCH] hange Uom.round into an instance method. issue4423 review18811002 --- move.py | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/move.py b/move.py index acb01984cf..509a372656 100644 --- a/move.py +++ b/move.py @@ -834,8 +834,8 @@ class Move(Workflow, ModelSQL, ModelView): success = False first = False values = { - 'quantity': Uom.round( - move.quantity - picked_qties, move.uom.rounding), + 'quantity': move.uom.round( + move.quantity - picked_qties), } to_write.extend([[move], values]) else: @@ -843,7 +843,7 @@ class Move(Workflow, ModelSQL, ModelView): for from_location, qty in to_pick: values = { 'from_location': from_location.id, - 'quantity': Uom.round(qty, move.uom.rounding), + 'quantity': move.uom.round(qty), } if first: to_write.extend([[move], values]) @@ -1152,7 +1152,6 @@ class Move(Workflow, ModelSQL, ModelView): pool = Pool() Location = pool.get('stock.location') Product = pool.get('product.product') - Uom = pool.get('product.uom') assert query is not None, ( "Query in Move.compute_quantities() can't be None") @@ -1221,6 +1220,6 @@ class Move(Workflow, ModelSQL, ModelView): location = key[0] product = product_getter(key) uom = default_uom[product] - quantities[key] = Uom.round(quantity, uom.rounding) + quantities[key] = uom.round(quantity) return quantities