i have project in odoo17 enterprise and we need to add functionality that prevents user from creation of higher profile users (admin>republic>region>district>mahalla), like district user cannot even see region or republic users but can crud mahalla users, they can only see their accounts(res.users): heres my files;
from odoo import fields, models, api
from odoo.exceptions import AccessError


class Users(models.Model):
    _inherit = "res.users"

    position = fields.Char(string='Position')
    type = fields.Selection([
        ('admin', 'Admin'),
        ('moderator', 'Moderator'),
        ('reader', 'Reader'),
    ], string='User Type', required=True, default='reader')
    
    role = fields.Selection([
        ('republic', 'Republic'),
        ('region', 'Region'),
        ('district', 'District'),
        ('mahalla', 'Mahalla'),
    ], string='Role', default='mahalla')
    
    region_id = fields.Many2one('region', string="Region")
    district_id = fields.Many2one('district', string="District")
    mahalla_id = fields.Many2one('mahalla', string="Mahalla")
    
    allowed_group_ids = fields.Many2many(
        'res.groups',
        string='Allowed Groups',
        compute='_compute_allowed_group_ids'
    )

    @api.depends('type', 'role')
    def _compute_allowed_group_ids(self):
        current_user = self.env.user
        group_definitions = {
            'admin': 'mahallam.group_admin',
            'moderator': 'mahallam.group_moderator',
            'reader': 'mahallam.group_reader',
            'republic': 'mahallam.group_republic',
            'region': 'mahallam.group_region',
            'district': 'mahallam.group_district',
            'mahalla': 'mahallam.group_mahalla',
            'localization': 'mahallam.group_localization',
            'hierarchical': 'mahallam.group_hierarchical',
            'application': 'mahallam.group_application',
            'announcement': 'mahallam.group_announcement',
            'notification': 'mahallam.group_notification',
            'questionnaire': 'mahallam.group_questionnaire',
            'user_questionnaire': 'mahallam.group_user_questionnaire',
        }

        allowed_groups = []

        if current_user.type == 'admin':
            allowed_groups = group_definitions.values()
        elif current_user.type == 'moderator' and current_user.role == 'republic':
            allowed_groups.extend([
                group_definitions['moderator'],
                group_definitions['reader'],
                group_definitions['region'],
                group_definitions['district'],
                group_definitions['mahalla'],
                group_definitions['localization'],
                group_definitions['hierarchical'],
                group_definitions['application'],
                group_definitions['announcement'],
                group_definitions['notification'],
                group_definitions['questionnaire'],
                group_definitions['user_questionnaire'],
                ]
                )
        elif current_user.type == 'reader' and current_user.role == 'republic':
            allowed_groups.extend([
                group_definitions['moderator'],
                group_definitions['reader'],
                group_definitions['region'],
                group_definitions['district'],
                group_definitions['mahalla'],
                group_definitions['localization'],
                group_definitions['hierarchical'],
                group_definitions['application'],
                group_definitions['announcement'],
                group_definitions['notification'],
                group_definitions['questionnaire'],
                group_definitions['user_questionnaire'],]
                )
        elif current_user.type == 'moderator' and current_user.role == 'region':
            allowed_groups.extend([
                group_definitions['moderator'],
                group_definitions['reader'],
                group_definitions['region'],
                group_definitions['district'],
                group_definitions['mahalla'],
                group_definitions['application'],
                group_definitions['announcement'],
                group_definitions['notification'],
                group_definitions['questionnaire'],
                group_definitions['user_questionnaire'],]
                )
        elif current_user.type == 'reader' and current_user.role == 'region':
            allowed_groups.extend([
                group_definitions['moderator'],
                group_definitions['reader'],
                group_definitions['district'],
                group_definitions['mahalla'],
                group_definitions['application'],
                group_definitions['announcement'],
                group_definitions['notification'],
                group_definitions['questionnaire'],
                group_definitions['user_questionnaire'],]
                )
        elif current_user.type == 'moderator' and current_user.role == 'district':
            allowed_groups.extend([
                group_definitions['moderator'],
                group_definitions['reader'],
                group_definitions['mahalla'],
                group_definitions['application'],
                group_definitions['announcement'],
                group_definitions['notification'],
                group_definitions['questionnaire'],
                group_definitions['user_questionnaire'],]
                )
        elif current_user.type == 'reader' and current_user.role == 'district':
            allowed_groups.extend([
                group_definitions['moderator'],
                group_definitions['reader'],
                group_definitions['mahalla'],
                group_definitions['application'],
                group_definitions['announcement'],
                group_definitions['notification'],
                group_definitions['questionnaire'],
                group_definitions['user_questionnaire'],]
                )
        elif current_user.type == 'moderator' and current_user.role == 'mahalla':
            allowed_groups.extend([
                group_definitions['moderator'],
                group_definitions['reader'],
                group_definitions['application'],
                group_definitions['announcement'],
                group_definitions['notification'],
                group_definitions['questionnaire'],
                group_definitions['user_questionnaire'],]
                )
        elif current_user.type == 'reader' and current_user.role == 'mahalla':
            allowed_groups.extend([
                group_definitions['moderator'],
                group_definitions['reader'],
                group_definitions['application'],
                group_definitions['announcement'],
                group_definitions['notification'],
                group_definitions['questionnaire'],
                group_definitions['user_questionnaire'],]
                )

        self.allowed_group_ids = [(6, 0, [self.env.ref(group).id for group in allowed_groups if self.env.ref(group)])]

    @api.onchange('type')
    def _onchange_type(self):
        if self.type == 'admin':
            self.role = False
            self.region_id = False
            self.district_id = False
            self.mahalla_id = False
        self._update_role_visibility()
    
    @api.onchange('role')
    def _onchange_role(self):
        if self.type != 'admin':
            self._update_role_visibility()
    
    def _update_role_visibility(self):
        if self.type == 'admin':
            pass
        elif self.role == 'republic':
            pass
        elif self.role == 'region':
            self.district_id = False
            self.mahalla_id = False
        elif self.role == 'district':
            self.mahalla_id = False
        elif self.role == 'mahalla':
            pass

    def action_change_password(self):
        self.ensure_one()
        return {
            'type': 'ir.actions.act_window',
            'res_model': 'change.password.wizard',
            'view_mode': 'form',
            'view_id': self.env.ref('base.change_password_wizard_view').id,
            'target': 'new',
            'context': {'default_user_id': self.id},
        }

    def assign_group_based_on_role(self):
        self.ensure_one()

        admin_group = self.env.ref('mahallam.group_admin')
        group_republic = self.env.ref('mahallam.group_republic')
        group_region = self.env.ref('mahallam.group_region')
        group_district = self.env.ref('mahallam.group_district')
        group_mahalla = self.env.ref('mahallam.group_mahalla')
        group_mahalla = self.env.ref('mahallam.group_mahalla')
        group_reader = self.env.ref('mahallam.group_reader')
        group_moderator = self.env.ref('mahallam.group_moderator')
        group_hierarchical = self.env.ref('mahallam.group_hierarchical')
        group_localization = self.env.ref('mahallam.group_localization')
        group_application = self.env.ref('mahallam.group_application')
        group_announcement = self.env.ref('mahallam.group_announcement')
        group_notification = self.env.ref('mahallam.group_notification')
        group_questionnaire = self.env.ref('mahallam.group_questionnaire')
        group_user_questionnaire = self.env.ref('mahallam.group_user_questionnaire')

        self.groups_id = [
            (3, admin_group.id), (3, group_republic.id), (3, group_region.id),
            (3, group_district.id), (3, group_mahalla.id),
            (3, group_reader.id), (3, group_moderator.id),
            (3, group_hierarchical.id), (3, group_localization.id),
            (3, group_application.id), (3, group_announcement.id),
            (3, group_notification.id), (3, group_questionnaire.id),
            (3, group_user_questionnaire.id),
            ]
        
        if self.type == 'moderator' and self.role == 'republic':
            self.groups_id = [(4, group_moderator.id), (4, group_republic.id),(4, group_hierarchical.id)]
        elif self.type == 'reader' and self.role == 'republic':
            self.groups_id = [(4, group_reader.id), (4, group_republic.id), (4, group_hierarchical.id)]
        elif self.type == 'moderator' and self.role == 'region':
            self.groups_id = [(4, group_moderator.id), (4, group_region.id), (4, group_hierarchical.id), (4, group_localization.id)]
        elif self.type == 'reader' and self.role == 'region':
            self.groups_id = [(4, group_reader.id), (4, group_region.id), (4, group_hierarchical.id), (4, group_localization.id)]
        elif self.type == 'moderator' and self.role == 'district':
            self.groups_id = [(4, group_moderator.id), (4, group_district.id), (4, group_hierarchical.id), (4, group_localization.id)]
        elif self.type == 'reader' and self.role == 'district':
            self.groups_id = [(4, group_reader.id), (4, group_district.id), (4, group_hierarchical.id), (4, group_localization.id)]
        elif self.type == 'moderator' and self.role == 'mahalla':
            self.groups_id = [(4, group_moderator.id), (4, group_mahalla.id), (4, group_hierarchical.id), (4, group_localization.id)]
        elif self.type == 'reader' and self.role == 'mahalla':
            self.groups_id = [(4, group_reader.id), (4, group_mahalla.id), (4, group_hierarchical.id), (4, group_localization.id)]

    @api.model
    def create(self, vals):
        user = super(Users, self).create(vals)
        user.assign_group_based_on_role()
        return user

    def write(self, vals):
        res = super(Users, self).write(vals)
        if 'type' in vals or 'role' in vals:
            self.assign_group_based_on_role()
        return res
<?xml version="1.0" encoding="UTF-8"?>
<odoo>
    <data noupdate="1">
        <!-- Group Region res.users-->
        <record id="rule_localization_group_region" model="ir.rule">
            <field name="name">Region Localization Rule</field>
            <field name="model_id" ref="base.model_res_users"/>
            <field name="domain_force">[('region_id', '=', user.region_id.id)]</field>
            <field name="groups" eval="[(4, ref('mahallam.group_region'))]"/>
            <field name="perm_read" eval="False"/>  
            <field name="perm_write" eval="False"/>
            <field name="perm_create" eval="False"/>
            <field name="perm_unlink" eval="False"/>
        </record>

        <!-- Group District res.users-->
        <record id="rule_localization_group_district" model="ir.rule">
            <field name="name">District Localization Rule</field>
            <field name="model_id" ref="base.model_res_users"/>
            <field name="domain_force">[('district_id', '=', user.district_id.id)]</field>
            <field name="groups" eval="[(4, ref('mahallam.group_district'))]"/>
            <field name="perm_read" eval="False"/>
            <field name="perm_write" eval="False"/>
            <field name="perm_create" eval="False"/>
            <field name="perm_unlink" eval="False"/>
        </record>

        <!-- Group Mahalla res.users-->
        <record id="rule_localization_group_mahalla" model="ir.rule">
            <field name="name">Mahalla Localization Rule</field>
            <field name="model_id" ref="base.model_res_users"/>
            <field name="domain_force">[('mahalla_id', '=', user.mahalla_id.id)]</field>
            <field name="groups" eval="[(4, ref('mahallam.group_mahalla'))]"/>
            <field name="perm_read" eval="False"/>
            <field name="perm_write" eval="False"/>
            <field name="perm_create" eval="False"/>
            <field name="perm_unlink" eval="False"/>
        </record>

        <record id="rule_localization_announcement_group_region" model="ir.rule">
            <field name="name">Announcement Region Localization Rule</field>
            <field name="model_id" ref="mahallam.model_announcement"/>
            <field name="domain_force">[('region_id', '=', user.region_id.id)]</field>
            <field name="groups" eval="[(4, ref('mahallam.group_region'))]"/>
            <field name="perm_read" eval="False"/>
            <field name="perm_write" eval="False"/>
            <field name="perm_create" eval="False"/>
            <field name="perm_unlink" eval="False"/>
        </record>
        <record id="rule_localization_announcement_group_district" model="ir.rule">
            <field name="name">Announcement District Localization Rule</field>
            <field name="model_id" ref="mahallam.model_announcement"/>
            <field name="domain_force">[('district_id', '=', user.district_id.id)]</field>
            <field name="groups" eval="[(4, ref('mahallam.group_district'))]"/>
            <field name="perm_read" eval="False"/>
            <field name="perm_write" eval="False"/>
            <field name="perm_create" eval="False"/>
            <field name="perm_unlink" eval="False"/>
        </record>
        <record id="rule_localization_announcement_group_mahalla" model="ir.rule">
            <field name="name">Announcement Mahalla Localization Rule</field>
            <field name="model_id" ref="mahallam.model_announcement"/>
            <field name="domain_force">[('mahalla_id', '=', user.mahalla_id.id)]</field>
            <field name="groups" eval="[(4, ref('mahallam.group_mahalla'))]"/>
            <field name="perm_read" eval="False"/>
            <field name="perm_write" eval="False"/>
            <field name="perm_create" eval="False"/>
            <field name="perm_unlink" eval="False"/>
        </record>
        <record id="rule_localization_mahallam_application_group_region" model="ir.rule">
            <field name="name">Mahallam Application Region Localization Rule</field>
            <field name="model_id" ref="mahallam.model_mahallam_application"/>
            <field name="domain_force">[('region_id', '=', user.region_id.id)]</field>
            <field name="groups" eval="[(4, ref('mahallam.group_region'))]"/>
            <field name="perm_read" eval="False"/>
            <field name="perm_write" eval="False"/>
            <field name="perm_create" eval="False"/>
            <field name="perm_unlink" eval="False"/>
        </record>
        <record id="rule_localization_mahallam_application_group_district" model="ir.rule">
            <field name="name">Mahallam Application District Localization Rule</field>
            <field name="model_id" ref="mahallam.model_mahallam_application"/>
            <field name="domain_force">[('district_id', '=', user.district_id.id)]</field>
            <field name="groups" eval="[(4, ref('mahallam.group_district'))]"/>
            <field name="perm_read" eval="False"/>
            <field name="perm_write" eval="False"/>
            <field name="perm_create" eval="False"/>
            <field name="perm_unlink" eval="False"/>
        </record>
        <record id="rule_localization_mahallam_application_group_mahalla" model="ir.rule">
            <field name="name">Mahallam Application Mahalla Localization Rule</field>
            <field name="model_id" ref="mahallam.model_mahallam_application"/>
            <field name="domain_force">[('mahalla_id', '=', user.mahalla_id.id)]</field>
            <field name="groups" eval="[(4, ref('mahallam.group_mahalla'))]"/>
            <field name="perm_read" eval="False"/>
            <field name="perm_write" eval="False"/>
            <field name="perm_create" eval="False"/>
            <field name="perm_unlink" eval="False"/>
        </record>
        <record id="rule_localization_questionnaire_group_region" model="ir.rule">
            <field name="name">Questionnaire Region Localization Rule</field>
            <field name="model_id" ref="mahallam.model_questionnaire"/>
            <field name="domain_force">[('region_id', '=', user.region_id.id)]</field>
            <field name="groups" eval="[(4, ref('mahallam.group_region'))]"/>
            <field name="perm_read" eval="False"/>
            <field name="perm_write" eval="False"/>
            <field name="perm_create" eval="False"/>
            <field name="perm_unlink" eval="False"/>
        </record>
        <record id="rule_localization_questionnaire_group_district" model="ir.rule">
            <field name="name">Questionnaire District Localization Rule</field>
            <field name="model_id" ref="mahallam.model_questionnaire"/>
            <field name="domain_force">[('district_id', '=', user.district_id.id)]</field>
            <field name="groups" eval="[(4, ref('mahallam.group_district'))]"/>
            <field name="perm_read" eval="False"/>
            <field name="perm_write" eval="False"/>
            <field name="perm_create" eval="False"/>
            <field name="perm_unlink" eval="False"/>
        </record>
        <record id="rule_localization_questionnaire_group_mahalla" model="ir.rule">
            <field name="name">Questionnaire Mahalla Localization Rule</field>
            <field name="model_id" ref="mahallam.model_questionnaire"/>
            <field name="domain_force">[('mahalla_id', '=', user.mahalla_id.id)]</field>
            <field name="groups" eval="[(4, ref('mahallam.group_mahalla'))]"/>
            <field name="perm_read" eval="False"/>
            <field name="perm_write" eval="False"/>
            <field name="perm_create" eval="False"/>
            <field name="perm_unlink" eval="False"/>
        </record>
        <record id="rule_localization_user_questionnaire_group_region" model="ir.rule">
            <field name="name">User Questionnaire Region Localization Rule</field>
            <field name="model_id" ref="mahallam.model_user_questionnaire"/>
            <field name="domain_force">[('questionnaire_id.region_id', '=', user.region_id.id)]</field>
            <field name="groups" eval="[(4, ref('mahallam.group_region'))]"/>
            <field name="perm_read" eval="False"/>
            <field name="perm_write" eval="False"/>
            <field name="perm_create" eval="False"/>
            <field name="perm_unlink" eval="False"/>
        </record>
        <record id="rule_localization_user_questionnaire_group_district" model="ir.rule">
            <field name="name">User Questionnaire District Localization Rule</field>
            <field name="model_id" ref="mahallam.model_user_questionnaire"/>
            <field name="domain_force">[('questionnaire_id.district_id', '=', user.district_id.id)]</field>
            <field name="groups" eval="[(4, ref('mahallam.group_district'))]"/>
            <field name="perm_read" eval="False"/>
            <field name="perm_write" eval="False"/>
            <field name="perm_create" eval="False"/>
            <field name="perm_unlink" eval="False"/>
        </record>
        <record id="rule_localization_user_questionnaire_group_mahalla" model="ir.rule">
            <field name="name">User Questionnaire Mahalla Localization Rule</field>
            <field name="model_id" ref="mahallam.model_user_questionnaire"/>
            <field name="domain_force">[('questionnaire_id.mahalla_id', '=', user.mahalla_id.id)]</field>
            <field name="groups" eval="[(4, ref('mahallam.group_mahalla'))]"/>
            <field name="perm_read" eval="False"/>
            <field name="perm_write" eval="False"/>
            <field name="perm_create" eval="False"/>
            <field name="perm_unlink" eval="False"/>
        </record>
    </data>
</odoo><?xml version="1.0" encoding="UTF-8"?>
<odoo>
    <data noupdate="1">
        <record id="mahallam.group_admin" model="res.groups">
            <field name="name">Group admin</field>
            <field name="category_id" ref="base.module_category_hidden"/>
        </record>
        
        <record id="mahallam.group_republic" model="res.groups">
            <field name="name">Group republic</field>
            <field name="category_id" ref="base.module_category_hidden"/>
        </record>
        
        <record id="mahallam.group_region" model="res.groups">
            <field name="name">Group region</field>
            <field name="category_id" ref="base.module_category_hidden"/>
        </record>
        
        <record id="mahallam.group_district" model="res.groups">
            <field name="name">Group district</field>
            <field name="category_id" ref="base.module_category_hidden"/>
        </record>
        
        <record id="mahallam.group_mahalla" model="res.groups">
            <field name="name">Group mahalla</field>
            <field name="category_id" ref="base.module_category_hidden"/>
        </record>
        
        <record id="mahallam.group_reader" model="res.groups">
            <field name="name">Group reader</field>
            <field name="category_id" ref="base.module_category_hidden"/>
        </record>
        
        <record id="mahallam.group_moderator" model="res.groups">
            <field name="name">Group moderator</field>
            <field name="category_id" ref="base.module_category_hidden"/>
        </record>
        
        <record id="mahallam.group_hierarchical" model="res.groups">
            <field name="name">Group hierarchical</field>
            <field name="category_id" ref="base.module_category_hidden"/>
        </record>
        
        <record id="mahallam.group_localization" model="res.groups">
            <field name="name">Group localization</field>
            <field name="category_id" ref="base.module_category_hidden"/>
        </record>
        
        <record id="mahallam.group_application" model="res.groups">
            <field name="name">Group application</field>
            <field name="category_id" ref="base.module_category_hidden"/>
        </record>
        
        <record id="mahallam.group_announcement" model="res.groups">
            <field name="name">Group announcement</field>
            <field name="category_id" ref="base.module_category_hidden"/>
        </record>
        
        <record id="mahallam.group_notification" model="res.groups">
            <field name="name">Group notification</field>
            <field name="category_id" ref="base.module_category_hidden"/>
        </record>
        
        <record id="mahallam.group_questionnaire" model="res.groups">
            <field name="name">Group questionnaire</field>
            <field name="category_id" ref="base.module_category_hidden"/>
        </record>
        
        <record id="mahallam.group_user_questionnaire" model="res.groups">
            <field name="name">Group user questionnaire</field>
            <field name="category_id" ref="base.module_category_hidden"/>
        </record>
        
        <record id="base.group_system" model="res.groups">
            <field name="name">Group system</field>
            <field name="category_id" ref="base.module_category_hidden"/>
        </record>
        
        <record id="base.group_user" model="res.groups">
            <field name="name">Group user</field>
            <field name="category_id" ref="base.module_category_hidden"/>
        </record>
        
    </data>
</odoo>

<?xml version="1.0" encoding="utf-8"?>
<odoo>
    <data>
        <!-- Tree View -->
        <record id="view_user_tree_custom" model="ir.ui.view">
            <field name="name">res.users.tree</field>
            <field name="model">res.users</field>
            <field name="arch" type="xml">
                <tree string="Users" default_order="create_date desc">
                    <field name="name"/>
                    <field name="type"/>
                    <field name="role"/>
                    <field name="position"/>
                    <field name="login"/>
                    <field name="phone"/>
                </tree>
            </field>
        </record>
        <!-- Form View -->
        <record id="view_user_form_custom" model="ir.ui.view">
            <field name="name">res.users.form.custom</field>
            <field name="model">res.users</field>
            <field name="priority" eval="1"/>
            <field name="arch" type="xml">
                <form>
                    <header>
                        <button string="Set Password"
                                type="object" name="action_change_password"
                                class="btn-primary"
                                invisible="id == False"/>
                    </header>
                    <sheet>
                        <div class="oe_avatar_group">
                            <field name="image_1920" widget="image" class="oe_avatar"/>
                        </div>
                        <group>
                            <group>
                                <field name="name" required="1"/>
                                <field name="email" invisible="1"/>
                                <field name="login" required="1"/>
                                <field name="phone" placeholder="+998 xx xxx xx xx"/>
                                <field name="type" required="1"/>
                                <field name="position" invisible="type == 'admin'"/>
                                <field name="role" 
                                        invisible="type == 'admin'" 
                                        required="type != 'admin'"/>
                                
                                <field name="region_id" 
                                        invisible="type == 'admin' or role != 'region' and role != 'district' and role != 'mahalla'" 
                                        required="role in ['region', 'district', 'mahalla']"
                                        />
                                
                                <field name="district_id"
                                        invisible="type == 'admin' or role != 'district' and role != 'mahalla'" 
                                        required="role in ['district', 'mahalla']"
                                        domain="[('region_id', '=', region_id)]"/>
                                
                                <field name="mahalla_id" 
                                        invisible="type == 'admin' or role != 'mahalla'" 
                                        required="role == 'mahalla'"
                                        domain="[('district_id', '=', district_id)]"/>
                                <separator string="Access Rights" colspan="4" invisible="type == 'admin'"/>
                                <field name="allowed_group_ids" invisible="1"/>
                                <field name="groups_id" 
                                    widget="many2many_checkboxes" 
                                    options="{'no_create': True}"
                                    domain="[('id', 'in', allowed_group_ids)]">
                                        <tree>
                                            <field name="name"/>
                                            <field name="category_id"/>
                                        </tree>
                                </field>
                            </group>
                        </group>
                    </sheet>
                </form>
            </field>
        </record>

        <!-- Kanban View -->
        <record id="view_user_kanban_custom" model="ir.ui.view">
            <field name="name">res.users.kanban</field>
            <field name="model">res.users</field>
            <field name="arch" type="xml">
                <kanban>
                    <field name="id"/>
                    <field name="image_1920"/>
                    <field name="name"/>
                    <field name="type"/>
                    <field name="role"/>
                    <field name="position"/>
                    <templates>
                        <t t-name="kanban-box">
                            <div class="oe_kanban_global_click o_kanban_record_has_image_fill o_res_partner_kanban">
                                <div class="o_kanban_image_fill_left d-none d-md-block"
                                    t-attf-style="background-image:url(#{kanban_image('res.users', 'image_128', record.id.raw_value)})"
                                    role="img"/>
                                <div class="oe_kanban_details">
                                    <strong class="o_kanban_record_title">
                                        <field name="name"/>
                                    </strong>
                                    <div>
                                        <strong>Type: </strong><field name="type"/>
                                    </div>
                                    <div t-if="record.role.raw_value">
                                        <strong>Role: </strong><field name="role"/>
                                    </div>
                                    <div t-if="record.position.raw_value">
                                        <strong>Position: </strong><field name="position"/>
                                    </div>
                                </div>
                            </div>
                        </t>
                    </templates>
                </kanban>
            </field>
        </record>

        <!-- Actions -->
        <record id="action_user_custom" model="ir.actions.act_window">
            <field name="name">Users</field>
            <field name="res_model">res.users</field>
            <field name="view_mode">form</field>
            <field name="view_id" ref="view_user_form_custom"/>
        </record>

        <record id="action_user_list" model="ir.actions.act_window">
            <field name="name">Users</field>
            <field name="res_model">res.users</field>
            <field name="view_mode">kanban,tree</field>
            <field name="view_id" ref="view_user_tree_custom"/>
        </record>

        <!-- Menus -->
        <menuitem
            id="user_menu"
            name="User Management"
            sequence="1"/>

        <menuitem
            id="user_managers_menu"
            name="Users"
            parent="user_menu"
            action="action_user_list"
            sequence="1"/>

        <menuitem
            id="user_add_menu"
            name="Add User"
            parent="user_menu"
            action="action_user_custom"
            sequence="2"/>
    </data>
</odoo>