|
@ -33,13 +33,14 @@ class res_groups(models.Model): |
|
|
'time, you get `user` passed as a browse record') |
|
|
'time, you get `user` passed as a browse record') |
|
|
|
|
|
|
|
|
@api.multi |
|
|
@api.multi |
|
|
def eval_dynamic_group_condition(self): |
|
|
|
|
|
|
|
|
def eval_dynamic_group_condition(self, uid=None): |
|
|
|
|
|
user = self.env['res.users'].browse([uid]) if uid else self.env.user |
|
|
result = all( |
|
|
result = all( |
|
|
self.mapped( |
|
|
self.mapped( |
|
|
lambda this: safe_eval( |
|
|
lambda this: safe_eval( |
|
|
this.dynamic_group_condition, |
|
|
this.dynamic_group_condition, |
|
|
{ |
|
|
{ |
|
|
'user': self.env.user, |
|
|
|
|
|
|
|
|
'user': user.sudo(), |
|
|
'any': any, |
|
|
'any': any, |
|
|
'all': all, |
|
|
'all': all, |
|
|
'filter': filter, |
|
|
'filter': filter, |
|
|