From 80f044f32ef630b389714872975ac68cdecd6455 Mon Sep 17 00:00:00 2001 From: Eduardo De Miguel Date: Thu, 7 Apr 2022 11:35:37 +0200 Subject: [PATCH] [FIX] Add recipients of the all related messages on the notification When using composer, doesn't include all recipients of the message on the notification. --- mail_show_follower/models/mail_mail.py | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/mail_show_follower/models/mail_mail.py b/mail_show_follower/models/mail_mail.py index 66e6829..b7d49ce 100644 --- a/mail_show_follower/models/mail_mail.py +++ b/mail_show_follower/models/mail_mail.py @@ -62,6 +62,11 @@ class MailMail(models.Model): group_portal = self.env.ref("base.group_portal") for mail_id in self.ids: mail = self.browse(mail_id) + message_recipients = self.search( + [ + ("message_id", "=", mail.message_id), + ] + ).mapped("recipient_ids") # if the email has a model, id and it belongs to the portal group if mail.model and mail.res_id and group_portal: obj = self.env[mail.model].browse(mail.res_id) @@ -69,7 +74,10 @@ class MailMail(models.Model): # if they do it must be a portal, we exclude internal # users of the system. if hasattr(obj, "message_follower_ids"): - partners_obj = obj.message_follower_ids.mapped("partner_id") + partners_obj = ( + obj.message_follower_ids.mapped("partner_id") + | message_recipients + ) # internal partners user_partner_ids = ( self.env["res.users"]