[FIX] ir_qweb groups: in order to compute the groups of a user, we are using cr and uid from request. In case we are rendering the template in a non-request context (for instance, automated tests), we have no cr and uid ; do not compute the user groups in this case.

bzr revid: sle@openerp.com-20140401153114-blxgbyp8zgx120r3
This commit is contained in:
Simon Lejeune
2014-04-01 17:31:14 +02:00
parent e07a30b390
commit 43beb0e752
+1 -1
View File
@@ -241,7 +241,7 @@ class QWeb(orm.AbstractModel):
if attribute_name == "groups":
cr = qwebcontext.get('request') and qwebcontext['request'].cr or None
uid = qwebcontext.get('request') and qwebcontext['request'].uid or None
can_see = self.user_has_groups(cr, uid, groups=attribute_value)
can_see = self.user_has_groups(cr, uid, groups=attribute_value) if cr and uid else False
if not can_see:
return ''
continue