From 7855319c5152ecd7c7c6cabbc036376ed4247c6b Mon Sep 17 00:00:00 2001 From: sonhd91 Date: Tue, 16 Jan 2024 10:24:41 +0700 Subject: [PATCH] [IMP] mail_composer_cc_bcc: corner cases - Normally a wizard opens on Odoo client side to prompt user to define an email address for partners that don't have one - But it's possible to bypass it, so we explicitly filter out partners with no email address - We also return "" instead of "False" for partner with no name, and odoo's tools.formataddr will just use the partner's email address --- mail_composer_cc_bcc/models/mail_mail.py | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/mail_composer_cc_bcc/models/mail_mail.py b/mail_composer_cc_bcc/models/mail_mail.py index a035776827..74ed88ff73 100644 --- a/mail_composer_cc_bcc/models/mail_mail.py +++ b/mail_composer_cc_bcc/models/mail_mail.py @@ -14,9 +14,7 @@ def format_emails(partners): - emails = [ - tools.formataddr((p.name or "False", p.email or "False")) for p in partners - ] + emails = [tools.formataddr((p.name or "", p.email)) for p in partners if p.email] return ", ".join(emails)