diff --git a/addons/mail/models/mail_channel.py b/addons/mail/models/mail_channel.py
index 824fa893a69..ea1174c52ea 100644
--- a/addons/mail/models/mail_channel.py
+++ b/addons/mail/models/mail_channel.py
@@ -781,7 +781,7 @@ class Channel(models.Model):
}
else:
notification = _('
') % (channel.id, channel.name,)
- self.message_post(body=notification, message_type="notification", subtype_xmlid="mail.mt_comment", author_id=partner.id)
+ self.message_post(body=notification, message_type="notification", subtype_xmlid="mail.mt_comment", author_id=partner.id, notify_by_email=False)
# broadcast the channel header to the added partner
self._broadcast(partner_ids)
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