From 4d73f955a93cee033fc7ca822a963699e4e32ef3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thibault=20Delavall=C3=A9e?= Date: Wed, 15 Jan 2014 12:58:25 +0100 Subject: [PATCH] [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 --- addons/mail/mail_thread.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/mail/mail_thread.py b/addons/mail/mail_thread.py index c9c26439e26..c2080955bff 100644 --- a/addons/mail/mail_thread.py +++ b/addons/mail/mail_thread.py @@ -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)