[FIX] crm: if email_from was not valid, the merge of lead was crashing with 'list index out of range' error (trying to reach first element of [])

bzr revid: qdp-launchpad@openerp.com-20130227121506-guwlypemmyl2tvgk
This commit is contained in:
Quentin (OpenERP) 2013-02-27 13:15:06 +01:00
parent 95ac70f834
commit d1219f9a97
1 changed files with 1 additions and 1 deletions

View File

@ -711,7 +711,7 @@ class crm_lead(base_stage, format_address, osv.osv):
'parent_id': parent_id,
'phone': lead.phone,
'mobile': lead.mobile,
'email': lead.email_from and tools.email_split(lead.email_from)[0],
'email': tools.email_split(lead.email_from) and tools.email_split(lead.email_from)[0] or False,
'fax': lead.fax,
'title': lead.title and lead.title.id or False,
'function': lead.function,