summaryrefslogtreecommitdiff
path: root/addons/website_crm/models
diff options
context:
space:
mode:
authorDavid Beguin <dbe@odoo.com>2019-09-26 08:31:01 +0000
committerDavid Beguin <dbe@odoo.com>2019-09-27 08:47:50 +0000
commit218f1c63ea32fac46e0cf814f62d7d6b1d3461a5 (patch)
tree00ba0f698ae759d0462dff117ac9c78f56522302 /addons/website_crm/models
parent9dfc9ac76cdf90db6136f58e92aa524c00a76d69 (diff)
[FIX] website : fix visitor email and phone computing
When a lead entered a wrong email address in the contact form, this crashes when loading visitor view. We were doing a email concatenation to have all the email address of the leads linked to the visitor. But as it is a cornet case that shouls not happens often (to have multiplus email address linked to the visitor) we will only keep the last email addresse entered by the visitor. Task ID: 2077182 PR #37472 Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
Diffstat (limited to 'addons/website_crm/models')
-rw-r--r--addons/website_crm/models/website_visitor.py6
1 files changed, 4 insertions, 2 deletions
diff --git a/addons/website_crm/models/website_visitor.py b/addons/website_crm/models/website_visitor.py
index 82fa1367967..fde52895f6a 100644
--- a/addons/website_crm/models/website_visitor.py
+++ b/addons/website_crm/models/website_visitor.py
@@ -33,8 +33,10 @@ class WebsiteVisitor(models.Model):
mapped_data = {}
for result in results:
visitor_info = mapped_data.get(result['visitor_id'], {'email': '', 'mobile': ''})
- visitor_info['email'] += result['email'] + ','
- visitor_info['mobile'] = result['mobile']
+ if result['email']:
+ visitor_info['email'] = result['email']
+ if result['mobile']:
+ visitor_info['mobile'] = result['mobile']
mapped_data[result['visitor_id']] = visitor_info
for visitor in self: