return False
def set_message_read(self, cr, uid, msg_ids, read=None, context=None):
- if msg_ids == None:
- return False
- if type(msg_ids) is not list:
- msg_ids=[msg_ids]
-
- partner_id = self.pool.get('res.users').browse(cr, uid, uid, context=context).partner_id.id
- notif_ids = self.search(cr, uid, [('partner_id', '=', partner_id), ('message_id', 'in', msg_ids)], context=context)
-
+ user_pid = self.pool.get('res.users').read(cr, uid, uid, ['partner_id'], context=context)['partner_id'][0]
+ notif_ids = self.search(cr, uid, [('partner_id', '=', user_pid), ('message_id', 'in', msg_ids)], context=context)
return self.write(cr, uid, notif_ids, {'read': read}, context=context)
def get_partners_to_notify(self, cr, uid, message, context=None):