From b49d5388ffc3ea60ae42c70896302d512b19615a Mon Sep 17 00:00:00 2001 From: Toufik Ben Jaa Date: Tue, 11 Dec 2018 08:32:12 +0000 Subject: [PATCH] [FIX] mail: crash on mail resend - When resending a failed mail the code could crash. The issue is caused by the fact that calling `_get_recipient_data` with the parameter `pids` only, returns as the partners' groups the value `None`. The codes that uses the result of this method consider the groups as an iterable and crash when trying to iterate on a `NoneType`. OPW-1916498 closes odoo/odoo#29408 --- addons/mail/wizard/mail_resend_message.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/mail/wizard/mail_resend_message.py b/addons/mail/wizard/mail_resend_message.py index c8ea6bb73c3..12255735871 100644 --- a/addons/mail/wizard/mail_resend_message.py +++ b/addons/mail/wizard/mail_resend_message.py @@ -68,7 +68,7 @@ class MailResendMessage(models.TransientModel): rdata = [] for pid, cid, active, pshare, ctype, notif, groups in self.env['mail.followers']._get_recipient_data(None, False, pids=to_send.ids): if pid and notif == 'email' or not notif: - pdata = {'id': pid, 'share': pshare, 'active': active, 'notif': 'email', 'groups': groups} + pdata = {'id': pid, 'share': pshare, 'active': active, 'notif': 'email', 'groups': groups or []} if not pshare and notif: # has an user and is not shared, is therefore user rdata.append(dict(pdata, type='user')) elif pshare and notif: # has an user and is shared, is therefore portal