From 14a2b6ee69e379895af577bb313e803e341216b4 Mon Sep 17 00:00:00 2001 From: "Harry (Open ERP)" Date: Thu, 22 Jan 2009 17:23:34 +0530 Subject: [PATCH] fixed bug : * when scheduller run with auto order point, should not create procurement of consumer product bzr revid: hmo@tinyerp.com-20090122115334-u5mfr2rz38lqb6ec --- addons/mrp/schedulers.py | 35 ++++++++++++++++++----------------- 1 file changed, 18 insertions(+), 17 deletions(-) diff --git a/addons/mrp/schedulers.py b/addons/mrp/schedulers.py index 27f2662f599..d1ac0841749 100644 --- a/addons/mrp/schedulers.py +++ b/addons/mrp/schedulers.py @@ -1,7 +1,7 @@ # -*- encoding: utf-8 -*- ############################################################################## # -# OpenERP, Open Source Management Solution +# OpenERP, Open Source Management Solution # Copyright (C) 2004-2009 Tiny SPRL (). All Rights Reserved # $Id$ # @@ -205,22 +205,23 @@ class mrp_procurement(osv.osv): continue if qty<=0: continue - proc_id = procurement_obj.create(cr, uid, { - 'name': 'OP:'+str(op.id), - 'date_planned': newdate.strftime('%Y-%m-%d'), - 'product_id': op.product_id.id, - 'product_qty': qty, - 'product_uom': op.product_uom.id, - 'location_id': op.warehouse_id.lot_input_id.id, - 'procure_method': 'make_to_order', - 'origin': op.name - }) - wf_service.trg_validate(uid, 'mrp.procurement', proc_id, - 'button_confirm', cr) - wf_service.trg_validate(uid, 'mrp.procurement', proc_id, - 'button_check', cr) - orderpoint_obj.write(cr, uid, [op.id], - {'procurement_id': proc_id}) + if op.product_id.type not in ('consu'): + proc_id = procurement_obj.create(cr, uid, { + 'name': 'OP:'+str(op.id), + 'date_planned': newdate.strftime('%Y-%m-%d'), + 'product_id': op.product_id.id, + 'product_qty': qty, + 'product_uom': op.product_uom.id, + 'location_id': op.warehouse_id.lot_input_id.id, + 'procure_method': 'make_to_order', + 'origin': op.name + }) + wf_service.trg_validate(uid, 'mrp.procurement', proc_id, + 'button_confirm', cr) + wf_service.trg_validate(uid, 'mrp.procurement', proc_id, + 'button_check', cr) + orderpoint_obj.write(cr, uid, [op.id], + {'procurement_id': proc_id}) offset += len(ids) if use_new_cursor: cr.commit()