From bbae9cdc00af41f890b4bac9e7b19c96b235313d Mon Sep 17 00:00:00 2001 From: Antonin Bourguignon Date: Tue, 18 Sep 2012 16:17:24 +0200 Subject: [PATCH] [FIX] read user login and email with a read() instead of a browse() this way, we prevent the auto-loading of all the user's fields which crashes the contact form while accessed by a portal user bzr revid: abo@openerp.com-20120918141724-fjhpu0m46ndgtble --- addons/portal_crm/wizard/contact.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/addons/portal_crm/wizard/contact.py b/addons/portal_crm/wizard/contact.py index 755b422f8ea..37e6a0ca6d1 100644 --- a/addons/portal_crm/wizard/contact.py +++ b/addons/portal_crm/wizard/contact.py @@ -47,10 +47,10 @@ class crm_contact_us(osv.TransientModel): @return current user's email if the user isn't "anonymous", None otherwise """ - user = self.pool.get('res.users').browse(cr, uid, uid, context=context) + user = self.pool.get('res.users').read(cr, uid, uid, ['login', 'email'], context) - if (user.login != 'anonymous'): - return user.email + if (user['login'] != 'anonymous'): + return user['email'] else: return None