[FIX] MRP : Only purchasable and active products should pass scheduler for the orderp...
authorDukai Gábor <>
Mon, 3 Jan 2011 13:07:00 +0000 (18:37 +0530)
committerJay (OpenERP) <jvo@tinyerp.com>
Mon, 3 Jan 2011 13:07:00 +0000 (18:37 +0530)
lp bug: https://launchpad.net/bugs/627936 fixed

bzr revid: jvo@tinyerp.com-20110103130700-eydesa4ojeykc5mj

addons/mrp/schedulers.py

index 3d4d6a9..46d7511 100644 (file)
@@ -185,7 +185,10 @@ class mrp_procurement(osv.osv):
         if automatic:
             self.create_automatic_op(cr, uid, context=context)
         while ids:
-            ids = orderpoint_obj.search(cr, uid, [], offset=offset, limit=100)
+            ids = orderpoint_obj.search(cr, uid, [
+                ('product_id.active', '=', True),
+                ('product_id.purchase_ok', '=', True),
+            ], offset=offset, limit=100)
             for op in orderpoint_obj.browse(cr, uid, ids):
                 if op.procurement_id and op.procurement_id.purchase_id and op.procurement_id.purchase_id.state in ('draft', 'confirmed'):
                     continue