← Back to team overview

openerp-dev-web team mailing list archive

[Merge] lp:~openerp-dev/openobject-addons/5.0-bug-751966-nep into lp:openobject-addons/5.0

 

Nehal Panchal (Open ERP) has proposed merging lp:~openerp-dev/openobject-addons/5.0-bug-751966-nep into lp:openobject-addons/5.0.

Requested reviews:
  Anup(OpenERP) (ach-openerp)
Related bugs:
  Bug #751966 in OpenERP Addons: "Bad factor calculation en mrp_production action_compute"
  https://bugs.launchpad.net/openobject-addons/+bug/751966

For more details, see:
https://code.launchpad.net/~openerp-dev/openobject-addons/5.0-bug-751966-nep/+merge/62457

Hello,

UoM calculation was malfunctioning in MRP.

It has been fixed.

Thanks
-- 
https://code.launchpad.net/~openerp-dev/openobject-addons/5.0-bug-751966-nep/+merge/62457
Your team OpenERP R&D Team is subscribed to branch lp:~openerp-dev/openobject-addons/5.0-bug-751966-nep.
=== modified file 'mrp/mrp.py'
--- mrp/mrp.py	2011-03-31 13:47:44 +0000
+++ mrp/mrp.py	2011-05-26 10:46:48 +0000
@@ -470,8 +470,10 @@
 
             #if bom_point.routing_id and bom_point.routing_id.location_id:
             #   self.write(cr, uid, [production.id], {'location_src_id': bom_point.routing_id.location_id.id})
-
-            factor = production.product_qty * production.product_uom.factor_inv / bom_point.product_uom.factor
+            if production.product_uom.factor > bom_point.product_uom.factor:
+                factor = production.product_qty / production.product_uom.factor * bom_point.product_uom.factor
+            else: 
+                factor = production.product_qty * production.product_uom.factor_inv * bom_point.product_uom.factor
             res = self.pool.get('mrp.bom')._bom_explode(cr, uid, bom_point, factor / bom_point.product_qty, properties)
             results = res[0]
             results2 = res[1]
@@ -680,7 +682,7 @@
         pick_obj = self.pool.get('stock.picking')
         pick_obj.force_assign(cr, uid, [prod.picking_id.id for prod in self.browse(cr, uid, ids)])
         return True
-
+        
 mrp_production()
 
 


Follow ups