[FIX] mail_message: todo are now unread
authorThibault Delavallée <tde@openerp.com>
Tue, 26 Mar 2013 16:59:40 +0000 (17:59 +0100)
committerThibault Delavallée <tde@openerp.com>
Tue, 26 Mar 2013 16:59:40 +0000 (17:59 +0100)
bzr revid: tde@openerp.com-20130326165940-isag9vxn22vinlgy

addons/mail/mail_message.py

index 2f56e62..156ceac 100644 (file)
@@ -269,15 +269,15 @@ class mail_message(osv.Model):
 
         # all message have notifications: already set them as (un)starred
         if len(notif_ids) == len(msg_ids) or not create_missing:
-            notification_obj.write(cr, uid, notif_ids, {'starred': starred}, context=context)
+            notification_obj.write(cr, uid, notif_ids, {'starred': starred, 'read': False}, context=context)
             return starred
 
         # some messages do not have notifications: find which one, create notification, update starred status
         notified_msg_ids = [notification.message_id.id for notification in notification_obj.browse(cr, uid, notif_ids, context=context)]
         to_create_msg_ids = list(set(msg_ids) - set(notified_msg_ids))
         for msg_id in to_create_msg_ids:
-            notification_obj.create(cr, uid, {'partner_id': user_pid, 'starred': starred, 'message_id': msg_id}, context=context)
-        notification_obj.write(cr, uid, notif_ids, {'starred': starred}, context=context)
+            notification_obj.create(cr, uid, {'partner_id': user_pid, 'starred': starred, 'message_id': msg_id, 'read': False}, context=context)
+        notification_obj.write(cr, uid, notif_ids, {'starred': starred,  'read': False}, context=context)
         return starred
 
     #------------------------------------------------------