[FIX] runbot: remove user_has_groups calls

The method was removed in odoo/odoo#151597
This commit is contained in:
William Braeckman 2024-12-13 08:40:51 +01:00 committed by xdo
parent 33bef243d2
commit eacd2f369d
2 changed files with 2 additions and 2 deletions

View File

@ -175,7 +175,7 @@ class BuildError(models.Model):
def write(self, vals):
if 'active' in vals:
for build_error in self:
if not (self.env.su or self.user_has_groups('runbot.group_runbot_admin')):
if not (self.env.su or self.env.user.has_groups('runbot.group_runbot_admin')):
if build_error.test_tags:
raise UserError("This error as a test-tag and can only be (de)activated by admin")
if not vals['active'] and build_error.active and build_error.last_seen_date and build_error.last_seen_date + relativedelta(days=1) > fields.Datetime.now():

View File

@ -308,7 +308,7 @@ class Remote(models.Model):
raise
def action_check_token(self):
if not self.user_has_groups('runbot.group_runbot_admin'):
if not self.env.user.has_group('runbot.group_runbot_admin'):
raise UserError('This action is restricted to admin users')
token_results = {}
for repo in self: