Compare commits

...

1 Commits

Author SHA1 Message Date
Raphael Collet
53d683cf10 [IMP] core: remove user_has_groups()
Simply align the documentation with the new API and usage of method
user.has_group().
2024-03-15 11:24:37 +01:00
2 changed files with 7 additions and 7 deletions

View File

@@ -451,12 +451,12 @@ The urls in the actions list can be generated automatically by calling the
new_group = ( new_group = (
'group_trip_manager', 'group_trip_manager',
lambda partner: bool(partner.user_ids) and lambda partner: any(
any(user.has_group('business.group_trip_manager') user.sudo().has_group('business.group_trip_manager')
for user in partner.user_ids), for user in partner.user_ids
{ ),
'actions': trip_actions, {'actions': trip_actions},
}) )
return [new_group] + groups return [new_group] + groups

View File

@@ -213,7 +213,7 @@ can not be trusted, ACL being only verified during CRUD operations.
# this method is public and its arguments can not be trusted # this method is public and its arguments can not be trusted
def action_done(self): def action_done(self):
if self.state == "draft" and self.user_has_groups('base.manager'): if self.state == "draft" and self.env.user.has_group('base.manager'):
self._set_state("done") self._set_state("done")
# this method is private and can only be called from other python methods # this method is private and can only be called from other python methods