From 956ff0a204f71e316271efb8b9abfbe0767d4f01 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric=20Krier?= Date: Tue, 16 Sep 2014 10:06:42 +0200 Subject: [PATCH] Round remainder to prevent precision lost Precision can be lost also with only substraction, so the remainder must be rounded each time. issue4067 review6521002 --- stock.py | 1 + 1 file changed, 1 insertion(+) diff --git a/stock.py b/stock.py index d1deed38bf..6a08393308 100644 --- a/stock.py +++ b/stock.py @@ -59,6 +59,7 @@ class Move: 'uom': uom.id, })) remainder -= quantity + remainder = Uom.round(remainder, uom.rounding) if count: count -= 1 assert remainder >= 0