summaryrefslogtreecommitdiff
path: root/addons/mass_mailing/wizard
diff options
context:
space:
mode:
authorPierre Masereel <pim@odoo.com>2017-05-04 18:16:46 +0200
committerPierre Masereel <pim@odoo.com>2017-05-04 18:16:46 +0200
commit2c666af5d1d9eb49b04664ed871f932a34aa22cb (patch)
tree7b7043bee6c72bbb94f62731a16ebb9c7b23f533 /addons/mass_mailing/wizard
parent9dc53b620cca69ae537e44e776104191f1eabbc0 (diff)
[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
Diffstat (limited to 'addons/mass_mailing/wizard')
-rw-r--r--addons/mass_mailing/wizard/mail_compose_message.py4
1 files 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