diff options
| author | Aurélien Warnon <awa@odoo.com> | 2020-04-08 13:58:32 +0000 |
|---|---|---|
| committer | Thibault Delavallée <tde@odoo.com> | 2020-04-15 07:37:51 +0000 |
| commit | 66cd5dc3c5398a1726a977def36d2f121aca3996 (patch) | |
| tree | d05a5129940ebdf6360e81dc8a36419377d531e9 /addons/crm_iap_lead | |
| parent | 342ab37835156f89b204323ed9f8fee05e21d502 (diff) | |
[IMP] crm_iap_lead: use first email from lead mining instead of all
When a lead is generated from the lead mining request, we use all the returned
email addresses to populate the 'email_from' of the lead (joined with ',').
This is inconvenient because it adds a lot of noise on a lead that is supposed
to be nicely enriched and also prevents from sending emails through the chatter
easily.
This commit changes the behavior to only use the first returned email to
populate the 'email_from' field.
All other emails will still be available on the chatter post that contains the
detailed lead information.
This is the case for leads generated through the "Generate Leads" button but
also for leads generated through the website (using rules).
PR #40349
Task 2081471
Diffstat (limited to 'addons/crm_iap_lead')
| -rw-r--r-- | addons/crm_iap_lead/models/crm_iap_lead_helpers.py | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/addons/crm_iap_lead/models/crm_iap_lead_helpers.py b/addons/crm_iap_lead/models/crm_iap_lead_helpers.py index 4c327a9c8b2..5a2d80923c0 100644 --- a/addons/crm_iap_lead/models/crm_iap_lead_helpers.py +++ b/addons/crm_iap_lead/models/crm_iap_lead_helpers.py @@ -43,7 +43,7 @@ class CRMHelpers(models.Model): # Lead vals from data 'name': company_data['name'] or company_data['domain'], 'partner_name': company_data['legal_name'] or company_data['name'], - 'email_from': ",".join(company_data['email'] or []), + 'email_from': next(iter(company_data.get('email', [])), ''), 'phone': company_data['phone'] or (company_data['phone_numbers'] and company_data['phone_numbers'][0]) or '', 'website': website_url, 'street': company_data['location'], |
