[FIX] crm: fix bug introduced by new api in #aa44700

Before migration:
  'phone': customer and customer.phone or lead.phone,
After migration:
  'phone': customer.phone if customer else self.phone,

So if a customer exists and that it has no phone, the phone
on the lead need to be preserved during convertion in opp.
This commit is contained in:
Jeremy Kersten
2016-09-20 12:25:45 +02:00
parent fe0cbf897d
commit 6d8ae0a039
+2 -2
View File
@@ -689,8 +689,8 @@ class Lead(FormatAddress, models.Model):
'partner_id': customer.id if customer else False,
'type': 'opportunity',
'date_open': fields.Datetime.now(),
'email_from': customer.email if customer else self.email_from,
'phone': customer.phone if customer else self.phone,
'email_from': customer and customer.email or self.email_from,
'phone': customer and customer.phone or self.phone,
'date_conversion': fields.Datetime.now(),
}
if not self.stage_id: