[REF] runbot: deduplicate res_users.py

Duplicate model inheritance for res.users
This commit is contained in:
William Braeckman 2025-01-02 12:05:09 +01:00
parent 7542f41fff
commit e66cd93c2c
3 changed files with 4 additions and 11 deletions

View File

@ -25,7 +25,6 @@ from . import res_users
from . import runbot
from . import team
from . import upgrade
from . import user
from . import version
# those imports have to be at the end otherwise the sql view cannot be initialised

View File

@ -10,6 +10,10 @@ class ResUsers(models.Model):
runbot_team_ids = fields.Many2many('runbot.team', string="Runbot Teams")
github_login = fields.Char('Github account')
# Add default action_id
action_id = fields.Many2one('ir.actions.actions',
default=lambda self: self.env.ref('runbot.open_view_warning_tree', raise_if_not_found=False))
_sql_constraints = [
(
"github_login_unique",

View File

@ -1,10 +0,0 @@
from odoo import models, fields
class User(models.Model):
_inherit = 'res.users'
# Add default action_id
action_id = fields.Many2one('ir.actions.actions',
default=lambda self: self.env.ref('runbot.open_view_warning_tree', raise_if_not_found=False))