Skip to content

Commit

Permalink
[IMP] mail_composer_cc_bcc: corner cases
Browse files Browse the repository at this point in the history
- 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
  • Loading branch information
sonhd91 committed Feb 6, 2024
1 parent cb6d85d commit 7855319
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions mail_composer_cc_bcc/models/mail_mail.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)


Expand Down

0 comments on commit 7855319

Please sign in to comment.