From 8b2ddb01b193ba3c5a5cf855d01231e4d5fb66ee Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20-=20Le=20Filament?= <30716308+remi-filament@users.noreply.github.com> Date: Thu, 6 Jun 2024 10:56:53 +0200 Subject: [PATCH] [FIX] crm: check if email_from is defined --- addons/crm/models/crm_lead.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/crm/models/crm_lead.py b/addons/crm/models/crm_lead.py index 20a4a070aa6d9..bfb5c39d7108b 100644 --- a/addons/crm/models/crm_lead.py +++ b/addons/crm/models/crm_lead.py @@ -1581,7 +1581,7 @@ def _message_partner_info_from_emails(self, emails, link_mail=False): name_from_email = self.partner_name or self.contact_name emails_normalized = tools.email_normalize_all(email) email_normalized = emails_normalized[0] if emails_normalized else False - if email.lower() == self.email_from.lower() or (email_normalized and self.email_normalized == email_normalized): + if (email and self.email_from and email.lower() == self.email_from.lower()) or (email_normalized and self.email_normalized == email_normalized): partner_info['full_name'] = tools.formataddr(( name_from_email, ','.join(emails_normalized) if emails_normalized else email))