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
@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