[IMP] sale_crm: oppurtuniry should be in proposition stage when convert into quota

bzr revid: hmo@tinyerp.com-20100908094505-ktm71trio33x6jw9
This commit is contained in:
Harry (OpenERP) 2010-09-08 15:15:05 +05:30
parent 905d44a10f
commit 3dc4767165
1 changed files with 4 additions and 2 deletions

View File

@ -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:
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: