Skip to content
Snippets Groups Projects
Commit 2c666af5 authored by Pierre Masereel's avatar Pierre Masereel
Browse files

[FIX] mass_mailing: send mail to partner without email

When you send a mass mailing to muiltiple partner, if some of them have
no email adresse, it can lead to errors because of the variable 'recips'
is not set if the first occurence in the 'for loop' has no email.

To fix this, we always set the variable 'recips' by replacing the 'elif'
close by a 'else' one

introduced in rev: https://github.com/odoo/odoo/commit/65ed4553a50fdbefc986b7d21f87a81c42b743c7
parent 9dc53b62
Branches
Tags
No related merge requests found
......@@ -61,8 +61,8 @@ class MailComposeMessage(models.TransientModel):
mail_values = res[res_id]
if mail_values.get('email_to'):
recips = tools.email_split(mail_values['email_to'])
elif mail_values.get('recipient_ids') and partners_email.get(res_id):
recips = tools.email_split(partners_email[res_id])
else:
recips = tools.email_split(partners_email.get(res_id))
mail_to = recips[0].lower() if recips else False
if (blacklist and mail_to in blacklist) or (seen_list and mail_to in seen_list):
# prevent sending to blocked addresses that were included by mistake
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment