Reviewers: ,


Please review this at http://codereview.tryton.org/640002/

Affected files:
  M bom.py


Index: bom.py
===================================================================

--- a/bom.py
+++ b/bom.py
@@ -5,6 +5,7 @@
 from trytond.transaction import Transaction
 from trytond.pyson import Eval
 from trytond.pool import Pool
+from math import ceil


 __all__ = ['BOM', 'BOMInput', 'BOMOutput', 'BOMTree', 'OpenBOMTreeStart',
@@ -117,7 +118,7 @@

     def compute_quantity(self, factor):
         Uom = Pool().get('product.uom')
-        return Uom.round(self.quantity * factor, self.uom.rounding)
+        return ceil(self.quantity / self.uom.rounding) * self.uom.rounding


 class BOMOutput(BOMInput):



--
--
[email protected] mailing list



Reply via email to