From b62f3a35704c9f52e5dfb9426483db55d668259b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20BEAU?= Date: Tue, 19 Feb 2019 23:05:32 +0100 Subject: [PATCH] [IMP] by default do not send an email when user_id is fill on object --- mail_usability/models/mail.py | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/mail_usability/models/mail.py b/mail_usability/models/mail.py index 4163499..a17c91a 100644 --- a/mail_usability/models/mail.py +++ b/mail_usability/models/mail.py @@ -5,11 +5,24 @@ from odoo import models, api +import logging +_logger = logging.getLogger(__name__) class MailThread(models.AbstractModel): _inherit = 'mail.thread' + def _active_message_auto_subscribe_notify(self): + _logger.debug('Skip automatic subscribe notification') + return False + + def _message_auto_subscribe_notify(self, partner_ids): + if self._active_message_auto_subscribe_notify(): + return super(MailThread, self)._message_auto_subscribe_notify( + partner_ids) + else: + return True + @api.multi @api.returns('self', lambda value: value.id) def message_post(self, body='', subject=None, message_type='notification',