[IMP] no need to compute *all* has_group calls if the first one fails

This commit is contained in:
Xavier Morel 2014-06-17 12:00:50 +02:00
parent e555855f07
commit 63a6ba92e2
1 changed files with 2 additions and 2 deletions

View File

@ -1704,8 +1704,8 @@ class BaseModel(object):
:return: True if the current user is a member of one of the
given groups
"""
return any([self.pool.get('res.users').has_group(cr, uid, group_ext_id)
for group_ext_id in groups.split(',')])
return any(self.pool['res.users'].has_group(cr, uid, group_ext_id)
for group_ext_id in groups.split(','))
def _get_default_form_view(self, cr, user, context=None):
""" Generates a default single-line form view using all fields