[FIX] Fixed the fix, because actually we could have a contact_email and not a contact_name according to the regex. Should be working fine now.

bzr revid: tde@openerp.com-20130131160924-cp0xcj7nm7zbb07v
This commit is contained in:
Thibault Delavallée 2013-01-31 17:09:24 +01:00
parent cc79a9b3b6
commit 08ca917d5b
1 changed files with 2 additions and 0 deletions

View File

@ -750,6 +750,8 @@ class crm_lead(base_stage, format_address, osv.osv):
partner_id = self._lead_create_contact(cr, uid, lead, lead.contact_name, False, context=context)
elif lead.email_from:
contact_name, contact_email = self.pool.get('res.partner')._parse_partner_name(lead.email_from, context=context)
if not contact_name and contact_email:
contact_name = contact_email
partner_id = self._lead_create_contact(cr, uid, lead, contact_name, False, context=context)
else:
partner_id = self._lead_create_contact(cr, uid, lead, lead.name, False, context=context)