From c28547a010cbe6255090e87ddb5514684727ed63 Mon Sep 17 00:00:00 2001 From: Thomas Binsfeld Date: Thu, 15 Feb 2018 15:35:17 +0100 Subject: [PATCH] [9.0] [FIX] Mail Optional Follower Notification: populate needaction partners only with recipients From commit 1665bc95ec47a3cf1caa0171e1daf8da18151112 in 10.0 --- .../models/mail_message.py | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/mail_optional_follower_notification/models/mail_message.py b/mail_optional_follower_notification/models/mail_message.py index fe64abc0..fb2a98a3 100644 --- a/mail_optional_follower_notification/models/mail_message.py +++ b/mail_optional_follower_notification/models/mail_message.py @@ -17,3 +17,13 @@ class MailMessage(models.Model): force_partners_to_notify = [d['id'] for d in partner_list] ctx['force_partners_to_notify'] = force_partners_to_notify return super(MailMessage, self.with_context(ctx)).create(values) + + @api.multi + def _notify(self, force_send=False, user_signature=True): + res = super(MailMessage, self)._notify( + force_send=force_send, user_signature=user_signature) + if self.env.context.get('force_partners_to_notify'): + # Needaction only for recipients + self.needaction_partner_ids = [ + (6, 0, self.env.context.get('force_partners_to_notify'))] + return res