[FIX] mail: mail_thread: fixed a bug in subscription, new followers

could overwrite the subscription of previous followers.

This has already been fixed in saas-2 branch at revision 9079 (revid
tde@openerp.com-20140109131748-hgtflp40pmjhlhu2). But the fix is also
valid for the 7.0 stable branch.

bzr revid: tde@openerp.com-20140115115825-fniobvz33sssvrwd
This commit is contained in:
Thibault Delavallée 2014-01-15 12:58:25 +01:00
parent 2170efe270
commit 4d73f955a9
1 changed files with 1 additions and 1 deletions

View File

@ -1203,7 +1203,7 @@ class mail_thread(osv.AbstractModel):
self.check_access_rule(cr, uid, ids, 'write')
existing_pids_dict = {}
fol_ids = mail_followers_obj.search(cr, SUPERUSER_ID, [('res_model', '=', self._name), ('res_id', 'in', ids)])
fol_ids = mail_followers_obj.search(cr, SUPERUSER_ID, ['&', '&', ('res_model', '=', self._name), ('res_id', 'in', ids), ('partner_id', 'in', partner_ids)])
for fol in mail_followers_obj.browse(cr, SUPERUSER_ID, fol_ids, context=context):
existing_pids_dict.setdefault(fol.res_id, set()).add(fol.partner_id.id)