summaryrefslogtreecommitdiff
path: root/addons/mail/models/mail_message.py
diff options
context:
space:
mode:
authorThibault Delavallée <tde@odoo.com>2018-04-10 15:53:51 +0200
committerThibault Delavallée <tde@odoo.com>2018-04-10 17:15:26 +0200
commit3f7c75ef1f6094b1d47ec8f8564a5c0511d2d6ba (patch)
tree10c610b8823a249515c10c507b46a055cefa5f8a /addons/mail/models/mail_message.py
parent07ae0ccc4e4b4f79cf299f2a54ad3ee5e3a250af (diff)
[IMP] mail: display white background for user notifications in chatter
User notifications are defined as * notes; * pushed to user Inbox or email through classic notification process; * not linked to any document, meaning model and res_id are void; When pushed in user's Inbox they are currently displayed with a gray background like all notes. However UX experts think it should use a white background to be easier to spot in chatter. This commit makes it work. From now on discussion and user's notifications are displayed using a white background. This commit is related to task ID 1829872.
Diffstat (limited to 'addons/mail/models/mail_message.py')
-rw-r--r--addons/mail/models/mail_message.py4
1 files changed, 3 insertions, 1 deletions
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)