From 3dc476716595f6cfde22e9346ae6fd9c0a186d9c Mon Sep 17 00:00:00 2001 From: "Harry (OpenERP)" Date: Wed, 8 Sep 2010 15:15:05 +0530 Subject: [PATCH] [IMP] sale_crm: oppurtuniry should be in proposition stage when convert into quota bzr revid: hmo@tinyerp.com-20100908094505-ktm71trio33x6jw9 --- addons/sale_crm/wizard/crm_make_sale.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/addons/sale_crm/wizard/crm_make_sale.py b/addons/sale_crm/wizard/crm_make_sale.py index 7d9e4086f52..9d20b0dea4a 100644 --- a/addons/sale_crm/wizard/crm_make_sale.py +++ b/addons/sale_crm/wizard/crm_make_sale.py @@ -147,7 +147,9 @@ class crm_make_sale(osv.osv_memory): value['discount']=line.discount value['notes']=line.notes sale_line_obj.create(cr, uid, value) - case_obj.write(cr, uid, [case.id], {'ref': 'sale.order,%s' % new_id}) + stage_data = mod_obj._get_id(cr, uid, 'crm', 'stage_lead3') + stage_data = mod_obj.read(cr, uid, stage_data, ['res_id']) + case_obj.write(cr, uid, [case.id], {'ref': 'sale.order,%s' % new_id, 'stage_id': stage_data['res_id']}) new_ids.append(new_id) message = _('Opportunity ') + " '" + case.name + "' "+ _("is converted to Sales Quotation.") self.log(cr, uid, case.id, message) @@ -244,4 +246,4 @@ class sale_order_make_line(osv.osv_memory): sale_order_make_line() -# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: \ No newline at end of file +# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: