[IMP] mail_thread: do not subscribe followers already subscribed.
bzr revid: tde@openerp.com-20120813183312-qpuksy9ku7z5zemx
This commit is contained in:
parent
ceff2d6110
commit
59d8cb124c
|
@ -973,7 +973,10 @@ class mail_thread(osv.Model):
|
||||||
:param user_ids: a list of user_ids; if not set, subscribe
|
:param user_ids: a list of user_ids; if not set, subscribe
|
||||||
uid instead
|
uid instead
|
||||||
"""
|
"""
|
||||||
|
follower_ids = [follower.id for thread in self.browse(cr, uid, ids, context=context) for follower in thread.message_subscriber_ids]
|
||||||
to_subscribe_uids = [uid] if user_ids is None else user_ids
|
to_subscribe_uids = [uid] if user_ids is None else user_ids
|
||||||
|
if all(follower_id in follower_ids for follower_id in to_subscribe_uids):
|
||||||
|
return follower_ids
|
||||||
write_res = self.write(cr, uid, ids, {'message_subscriber_ids': [(4, id) for id in to_subscribe_uids]}, context=context)
|
write_res = self.write(cr, uid, ids, {'message_subscriber_ids': [(4, id) for id in to_subscribe_uids]}, context=context)
|
||||||
return [follower.id for thread in self.browse(cr, uid, ids, context=context) for follower in thread.message_subscriber_ids]
|
return [follower.id for thread in self.browse(cr, uid, ids, context=context) for follower in thread.message_subscriber_ids]
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue