Round remainder to prevent precision lost

Precision can be lost also with only substraction, so the remainder must be
rounded each time.

issue4067
review6521002
This commit is contained in:
Cédric Krier committed 2014-09-16 10:06:42 +02:00
1 parent 2c5d3cb123
commit 956ff0a204
1 file changed
+1
+1
View File
@@ -59,6 +59,7 @@ class Move:
'uom': uom.id,
}))
remainder -= quantity
remainder = Uom.round(remainder, uom.rounding)
if count:
count -= 1
assert remainder >= 0