[CLEAN] mail_followers: cleaned set_message_read code.
bzr revid: tde@openerp.com-20121016075719-qba8zt9gp6lvwmpn
This commit is contained in:
@@ -84,14 +84,8 @@ class mail_notification(osv.Model):
|
||||
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):
|
||||
|
||||
Reference in New Issue
Block a user