[IMP]:removed print and pass uid
bzr revid: apa@tinyerp.com-20120829072633-c13fg277j6be8182
This commit is contained in:
@@ -1050,13 +1050,11 @@ class mail_thread(osv.Model):
|
||||
to_subscribe_uids = [uid] if user_ids is None else user_ids
|
||||
write_res = self.write(cr, uid, ids, {'message_follower_ids': self.message_subscribe_get_command(cr, uid, to_subscribe_uids, context)}, context=context)
|
||||
follower_ids = [follower.id for thread in self.browse(cr, uid, ids, context=context) for follower in thread.message_follower_ids]
|
||||
print "self._name",self._name
|
||||
if not subtype_ids:
|
||||
subtype_obj = self.pool.get('mail.message.subtype')
|
||||
subtype_ids = subtype_obj.search(cr, uid, [('default', '=', 'true'),('model_ids.model', '=', self._name)])
|
||||
print "subtype_ids",subtype_ids
|
||||
if subtype_ids:
|
||||
self.message_subscribe_udpate_subtypes(cr, uid, ids, user_ids, subtype_ids, context=context)
|
||||
self.message_subscribe_udpate_subtypes(cr, uid, ids, to_subscribe_uids, subtype_ids, context=context)
|
||||
return follower_ids
|
||||
|
||||
def message_subscribe_get_command(self, cr, uid, follower_ids, context=None):
|
||||
@@ -1202,7 +1200,7 @@ class mail_thread(osv.Model):
|
||||
|
||||
def message_subscribe_udpate_subtypes(self, cr, uid, ids, user_id, subtype_ids,context=None):
|
||||
subscription_obj = self.pool.get('mail.followers')
|
||||
subscription_ids = subscription_obj.search(cr, uid, [('res_model', '=', self._name), ('res_id', 'in', ids),('user_id','=',user_id)])
|
||||
subscription_ids = subscription_obj.search(cr, uid, [('res_model', '=', self._name), ('res_id', 'in', ids),('user_id','in',user_id)])
|
||||
return subscription_obj.write(cr, uid, subscription_ids, {'subtype_ids': [(6, 0 , subtype_ids)]}, context = context) #overright or add new one
|
||||
|
||||
def message_subscription_remove_subtype(self, cr, uid, ids, user_id, subtype_id):
|
||||
|
||||
Reference in New Issue
Block a user