From e92a31e2bb365a1453d555bbf8d18069ed94299a Mon Sep 17 00:00:00 2001 From: "vta vta@openerp.com" <> Date: Fri, 16 Nov 2012 08:57:44 +0100 Subject: [PATCH] [IMP] Now portal users can subscribe to public content. bzr revid: vta@openerp.com-20121116075744-tclpsjxi1ut6wvh8 --- addons/mail/mail_thread.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/addons/mail/mail_thread.py b/addons/mail/mail_thread.py index ee1a015396b..4f7871ca961 100644 --- a/addons/mail/mail_thread.py +++ b/addons/mail/mail_thread.py @@ -796,11 +796,12 @@ class mail_thread(osv.AbstractModel): def message_subscribe(self, cr, uid, ids, partner_ids, subtype_ids=None, context=None): """ Add partners to the records followers. """ - self.write(cr, uid, ids, {'message_follower_ids': [(4, pid) for pid in partner_ids]}, context=context) + self.check_access_rights(cr, uid, 'read') + self.write(cr, SUPERUSER_ID, ids, {'message_follower_ids': [(4, pid) for pid in partner_ids]}, context=context) # if subtypes are not specified (and not set to a void list), fetch default ones if subtype_ids is None: subtype_obj = self.pool.get('mail.message.subtype') - subtype_ids = subtype_obj.search(cr, uid, [('default', '=', True), '|', ('res_model', '=', self._name), ('res_model', '=', False)], context=context) + subtype_ids = subtype_obj.search(cr, SUPERUSER_ID, [('default', '=', True), '|', ('res_model', '=', self._name), ('res_model', '=', False)], context=context) # update the subscriptions fol_obj = self.pool.get('mail.followers') fol_ids = fol_obj.search(cr, SUPERUSER_ID, [('res_model', '=', self._name), ('res_id', 'in', ids), ('partner_id', 'in', partner_ids)], context=context)