Browse Source

[9.0] [FIX] Mail Optional Follower Notification: populate needaction partners only with recipients

From commit 1665bc95ec in 10.0
pull/166/merge
Thomas Binsfeld 6 years ago
committed by Holger Brunn
parent
commit
c28547a010
  1. 10
      mail_optional_follower_notification/models/mail_message.py

10
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
Loading…
Cancel
Save