From ccc35f5ab6bd44beee861073e16b7b2d3a04d1dd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thibault=20Delavall=C3=A9e?= Date: Tue, 18 Jan 2022 15:37:52 +0000 Subject: [PATCH] [FIX] mail: fix issue when computing ``_get_recipient_data`` If we call ``MailFollowers._get_recipient_data()`` with pids parameter being set to None there is a crash that is easily solved( list(None), should take list fallback before hand). Task-2739294 (Mail: Batch recipients fetch and improve its usage) Part-of: odoo/odoo#82167 --- addons/mail/models/mail_followers.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/mail/models/mail_followers.py b/addons/mail/models/mail_followers.py index 15777f5977b..6f3e661373c 100644 --- a/addons/mail/models/mail_followers.py +++ b/addons/mail/models/mail_followers.py @@ -136,7 +136,7 @@ SELECT DISTINCT ON (pid) * FROM ( ) AS x ORDER BY pid, notif """ - params = [subtype_id, records._name, tuple(records.ids), list(pids) or []] + params = [subtype_id, records._name, tuple(records.ids), list(pids or [])] self.env.cr.execute(query, tuple(params)) res = self.env.cr.fetchall() elif pids: