diff --git a/addons/im_livechat/static/src/js/im_livechat.js b/addons/im_livechat/static/src/js/im_livechat.js index fddf5ec6c2c..b392d337d04 100644 --- a/addons/im_livechat/static/src/js/im_livechat.js +++ b/addons/im_livechat/static/src/js/im_livechat.js @@ -237,6 +237,7 @@ var LivechatButton = Widget.extend({ is_needaction: false, is_note: data.is_note, is_discussion: data.is_discussion, + is_notification: data.is_notification, customer_email_data: [] }; diff --git a/addons/mail/models/mail_message.py b/addons/mail/models/mail_message.py index 989167905fd..4362358b864 100644 --- a/addons/mail/models/mail_message.py +++ b/addons/mail/models/mail_message.py @@ -392,8 +392,9 @@ class Message(models.Model): 'message_type': u'comment', 'id': 59, 'subject': False - 'is_note': True # only if the subtype is internal + 'is_note': True # only if the message is a note (subtype == note) 'is_discussion': False # only if the message is a discussion (subtype == discussion) + 'is_notification': False # only if the message is a note but is a notification aka not linked to a document like assignation } """ message_values = self.read([ @@ -419,6 +420,7 @@ class Message(models.Model): for message in message_values: message['is_note'] = message['subtype_id'] and subtypes_dict[message['subtype_id'][0]]['id'] == note_id message['is_discussion'] = message['subtype_id'] and subtypes_dict[message['subtype_id'][0]]['id'] == com_id + message['is_notification'] = message['is_note'] and not message['model'] and not message['res_id'] message['subtype_description'] = message['subtype_id'] and subtypes_dict[message['subtype_id'][0]]['description'] if message['model'] and self.env[message['model']]._original_module: message['module_icon'] = modules.module.get_module_icon(self.env[message['model']]._original_module) diff --git a/addons/mail/static/src/js/services/chat_manager.js b/addons/mail/static/src/js/services/chat_manager.js index ea6c9388f58..1abcd995084 100644 --- a/addons/mail/static/src/js/services/chat_manager.js +++ b/addons/mail/static/src/js/services/chat_manager.js @@ -1314,6 +1314,7 @@ var ChatManager = AbstractService.extend({ * @param {string} [data.info] * @param {boolean} data.is_discussion * @param {boolean} data.is_note + * @param {boolean} data.is_notification * @param {string} data.message_type * @param {string} [data.model] * @param {boolean} data.module_icon src url of the module icon @@ -1336,6 +1337,7 @@ var ChatManager = AbstractService.extend({ is_author: data.author_id && data.author_id[0] === session.partner_id, is_note: data.is_note, is_discussion: data.is_discussion, + is_notification: data.is_notification, is_system_notification: (data.message_type === 'notification' && data.model === 'mail.channel') || data.info === 'transient_message', attachment_ids: data.attachment_ids || [], diff --git a/addons/mail/static/src/xml/thread.xml b/addons/mail/static/src/xml/thread.xml index 1019b141b75..118e96da8ff 100644 --- a/addons/mail/static/src/xml/thread.xml +++ b/addons/mail/static/src/xml/thread.xml @@ -121,7 +121,7 @@ -
+