From 83677ed6e6d662ef715e14f99dda7f696dc23f93 Mon Sep 17 00:00:00 2001 From: Denis Ledoux Date: Fri, 24 Jan 2014 13:01:02 +0100 Subject: [PATCH] [REVERT] 9401 dle@openerp.com-20130830125155-1vedifnupu2xvth7 This had as side-effect to not allow splitting BOMs (a manufacturing order for 1 unit of a BOM producing 10 units consumed the lines like it was 10 units, not 1) This fix was to avoid having a fraction of a unit (for instance, 0.5 unit). But, finally, it is preferable to allow splitting units: 1. Most users do not use several uoms, and in this case, the unit is the default uom (hidden). 2. At the moment, it is allowed to ask a manufacturing order splitting up the unit uom (It is allowed to ask the production of 0.5 USB Adapter, for instance) Thus, we should allow the splitting up of the unit uom in the lines too. bzr revid: dle@openerp.com-20140124120102-we2yxio553ws2yz4 --- addons/mrp/mrp.py | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/addons/mrp/mrp.py b/addons/mrp/mrp.py index 038c608c26b..dfe45e927bc 100644 --- a/addons/mrp/mrp.py +++ b/addons/mrp/mrp.py @@ -324,10 +324,9 @@ class mrp_bom(osv.osv): """ routing_obj = self.pool.get('mrp.routing') factor = factor / (bom.product_efficiency or 1.0) - max_rounding = max(bom.product_rounding, bom.product_uom.rounding) - factor = rounding(factor, max_rounding) - if factor < max_rounding: - factor = max_rounding + factor = rounding(factor, bom.product_rounding) + if factor < bom.product_rounding: + factor = bom.product_rounding result = [] result2 = [] phantom = False