From 6d8ae0a039094afeb95deb2057cd2cac7383a88d Mon Sep 17 00:00:00 2001 From: Jeremy Kersten Date: Tue, 20 Sep 2016 10:27:58 +0200 Subject: [PATCH] [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. --- addons/crm/models/crm_lead.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/addons/crm/models/crm_lead.py b/addons/crm/models/crm_lead.py index 67e23f22d7d..fbd9c463a30 100644 --- a/addons/crm/models/crm_lead.py +++ b/addons/crm/models/crm_lead.py @@ -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: