""" Override of create to check that we can not create a notification
for a message the user can not read. """
if self.pool.get('mail.message').check_access_rights(cr, uid, 'read'):
- return super(self, mail_notification).create(cr, uid, vals, context=context)
+ return super(mail_notification, self).create(cr, uid, vals, context=context)
else:
return False
def _get_unread(self, cr, uid, ids, name, arg, context=None):
""" Compute if the message is unread by the current user. """
- res = dict.fromkeys(ids, False)
+ res = dict((id, {'unread': False}) for id in ids)
partner_id = self.pool.get('res.users').browse(cr, uid, uid, context=context).partner_id.id
notif_obj = self.pool.get('mail.notification')
notif_ids = notif_obj.search(cr, uid, [