hange Uom.round into an instance method.

issue4423
review18811002
This commit is contained in:
Karla Stenger committed 2016-01-11 10:30:50 -03:00
1 parent 27e9e5f9d5
commit 69ae155fa4
1 file changed
+4 -5
+4 -5
View File
@@ -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