From b1274847338e98c54737ee4ff343b81f7dbdd554 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thibault=20Delavall=C3=A9e?= Date: Thu, 20 Dec 2012 15:35:27 +0100 Subject: [PATCH] [IMP] set messages read when viewing chatter: search only unread notifications. bzr revid: tde@openerp.com-20121220143527-y98r2hftskgb9e3g --- addons/mail/mail_message.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/addons/mail/mail_message.py b/addons/mail/mail_message.py index 207b46de5d5..1d248aadb6f 100644 --- a/addons/mail/mail_message.py +++ b/addons/mail/mail_message.py @@ -538,8 +538,8 @@ class mail_message(osv.Model): # if requested: mark messages as read if context and context.get('mail_read_set_read'): message_ids = [message.get('id') for message in message_list] - notif_ids = notification_obj.search(cr, uid, [('partner_id.user_ids', 'in', uid), ('message_id', 'in', message_ids)], context=context) - notification_obj.write(cr, uid, notif_ids, {'read': True}, context=context) + unread_notif_ids = notification_obj.search(cr, uid, [('read', '=', False), ('partner_id.user_ids', 'in', uid), ('message_id', 'in', message_ids)], context=context) + notification_obj.write(cr, uid, unread_notif_ids, {'read': True}, context=context) # get the child expandable messages for the tree self._message_read_dict_postprocess(cr, uid, message_list, message_tree, context=context)