From 2946d78dd73559c1a2bfd35186ffb65003b95fed Mon Sep 17 00:00:00 2001 From: Denis Ledoux Date: Fri, 22 Dec 2017 16:17:09 +0100 Subject: [PATCH] [FIX] mail: set `user_id` to an inactive user partner sends a mail to the object partner_id Before this revision, Assigning a user for which its partner is inactive was sending the assignation notification email to the `partner_id` of the object. e.g. Assigning a task to a user for which its partner is disabled sent the assignation notification email to the customer of the task. opw-787659 --- addons/mail/models/mail_thread.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/mail/models/mail_thread.py b/addons/mail/models/mail_thread.py index 729f2981e5b..0a4f718b677 100644 --- a/addons/mail/models/mail_thread.py +++ b/addons/mail/models/mail_thread.py @@ -2142,7 +2142,7 @@ class MailThread(models.AbstractModel): # add followers coming from res.users relational fields that are tracked user_ids = [values[name] for name in user_field_lst if values.get(name)] - user_pids = [user.partner_id.id for user in self.env['res.users'].sudo().browse(user_ids)] + user_pids = [user.partner_id.id for user in self.env['res.users'].sudo().browse(user_ids) if user.partner_id.active] for partner_id in user_pids: new_partners.setdefault(partner_id, None)