From 2c666af5d1d9eb49b04664ed871f932a34aa22cb Mon Sep 17 00:00:00 2001 From: Pierre Masereel Date: Thu, 4 May 2017 18:16:46 +0200 Subject: [PATCH] [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 --- addons/mass_mailing/wizard/mail_compose_message.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/addons/mass_mailing/wizard/mail_compose_message.py b/addons/mass_mailing/wizard/mail_compose_message.py index 413415c9f5f..6c1fc81280e 100644 --- a/addons/mass_mailing/wizard/mail_compose_message.py +++ b/addons/mass_mailing/wizard/mail_compose_message.py @@ -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