From 6b572b8d9089403a7ea4c54ff31a72dccfd78a8f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thibault=20Delavall=C3=A9e?= Date: Wed, 22 May 2013 13:55:49 +0200 Subject: [PATCH] [CLEAN] portal/mail_thread: cleaned a bit new code, using is_portal. bzr revid: tde@openerp.com-20130522115549-ot3f31c5oty0zqya --- addons/portal/mail_thread.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/addons/portal/mail_thread.py b/addons/portal/mail_thread.py index 54fb0d26279..44bc4d0bde8 100644 --- a/addons/portal/mail_thread.py +++ b/addons/portal/mail_thread.py @@ -35,10 +35,9 @@ class mail_thread(osv.AbstractModel): res_id - opens the Inbox with context propagated """ - # if uid is a portal user -> action is different - portal_model, group_id = self.pool.get('ir.model.data').get_object_reference(cr, uid, 'portal', 'group_portal') cur_user = self.pool.get('res.users').browse(cr, SUPERUSER_ID, uid, context=context) - if group_id in [g.id for g in cur_user.groups_id]: + # if uid is a portal user -> action is different + if any(group.is_portal for group in cur_user.groups_id): return ('portal', 'action_mail_inbox_feeds_portal') else: return super(mail_thread, self)._get_inbox_action_xml_id(cr, uid, context=context)