~openerp-commiter/openobject-addons/5.0-opw-4137-dhs

« back to all changes in this revision

Viewing changes to mrp/schedulers.py

  • Committer: Jay(OpenERP)
  • Author(s): Dukai Gábor
  • Date: 2011-01-03 13:07:00 UTC
  • Revision ID: jvo@tinyerp.com-20110103130700-eydesa4ojeykc5mj
[FIX] MRP : Only purchasable and active products should pass scheduler for the orderpoint generation

Show diffs side-by-side

added added

removed removed

Lines of Context:
185
185
        if automatic:
186
186
            self.create_automatic_op(cr, uid, context=context)
187
187
        while ids:
188
 
            ids = orderpoint_obj.search(cr, uid, [], offset=offset, limit=100)
 
188
            ids = orderpoint_obj.search(cr, uid, [
 
189
                ('product_id.active', '=', True),
 
190
                ('product_id.purchase_ok', '=', True),
 
191
            ], offset=offset, limit=100)
189
192
            for op in orderpoint_obj.browse(cr, uid, ids):
190
193
                if op.procurement_id and op.procurement_id.purchase_id and op.procurement_id.purchase_id.state in ('draft', 'confirmed'):
191
194
                    continue