summaryrefslogtreecommitdiff
path: root/addons/mail/models/mail_thread.py
diff options
context:
space:
mode:
authorMitali Patel <mpa@odoo.com>2019-06-27 05:31:53 +0000
committerAlexandre Kühn <aku@odoo.com>2020-01-17 10:29:08 +0000
commit2d2b65ae8a67ba3e8d631bd0d711644823c4a19c (patch)
tree3d66a742ea84f8af44a2ef6064065ccaf21b5382 /addons/mail/models/mail_thread.py
parent0b11ed87b6d428bc102ff3f258f3f635863cc60b (diff)
[IMP] mail: do not send email on join/leave mailing channel
Before this commit, when a user joined, left, or was invited to a channel with "Send by email", it sent an email notification to every member. This commit disables email notification on subscribe/unsubscribe on a channel, while still showing messages on join/leave. Task-Id 2003281 closes odoo/odoo#35142 Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
Diffstat (limited to 'addons/mail/models/mail_thread.py')
-rw-r--r--addons/mail/models/mail_thread.py5
1 files changed, 3 insertions, 2 deletions
diff --git a/addons/mail/models/mail_thread.py b/addons/mail/models/mail_thread.py
index 0b7ac2b7b50..e560c7c2fb3 100644
--- a/addons/mail/models/mail_thread.py
+++ b/addons/mail/models/mail_thread.py
@@ -2100,7 +2100,7 @@ class MailThread(models.AbstractModel):
# Notification API
# ------------------------------------------------------
- def _notify_thread(self, message, msg_vals=False, **kwargs):
+ def _notify_thread(self, message, msg_vals=False, notify_by_email=True, **kwargs):
""" Main notification method. This method basically does two things
* call ``_notify_compute_recipients`` that computes recipients to
@@ -2131,7 +2131,8 @@ class MailThread(models.AbstractModel):
message_values['channel_ids'] = [(6, 0, [r['id'] for r in rdata['channels']])]
self._notify_record_by_inbox(message, rdata, msg_vals=msg_vals, **kwargs)
- self._notify_record_by_email(message, rdata, msg_vals=msg_vals, **kwargs)
+ if notify_by_email:
+ self._notify_record_by_email(message, rdata, msg_vals=msg_vals, **kwargs)
return rdata