[FIX] crm : When I have created new Lead without selecting customer, After that convert to opportunity and that time I have select Link to an exisiting customer and select customer and create Opportunity. In that Opportunity Form view i can not see email and phone of that customer.

bzr revid: mdi@tinyerp.com-20120925095635-93grheoj3oyh0o2i
This commit is contained in:
Divyesh Makwana (Open ERP) 2012-09-25 15:26:35 +05:30
parent c4479b8c95
commit 624c34cb78
1 changed files with 12 additions and 0 deletions

View File

@ -588,6 +588,16 @@ class crm_lead(base_stage, format_address, osv.osv):
else:
stage_ids = crm_stage.search(cr, uid, [('sequence','>=',1)])
stage_id = stage_ids and stage_ids[0] or False
email = False
phone = False
if customer and customer.email:
email = customer.email
else:
email = lead.email_from
if customer and customer.phone:
phone = customer.phone
else:
phone = lead.phone
return {
'planned_revenue': lead.planned_revenue,
'probability': lead.probability,
@ -598,6 +608,8 @@ class crm_lead(base_stage, format_address, osv.osv):
'stage_id': stage_id or False,
'date_action': time.strftime('%Y-%m-%d %H:%M:%S'),
'date_open': time.strftime('%Y-%m-%d %H:%M:%S'),
'email_from': email,
'phone': phone,
}
def convert_opportunity(self, cr, uid, ids, partner_id, user_ids=False, section_id=False, context=None):