Repository
OCA/server-backend · module folder · Try on Runboat
Module version
1.0.2
Category
Tools
Folder size
1.35 MB
License
LGPL-3
Application
No
Auto-installable
No
Website
https://github.com/OCA/server-backend
Last tracking update
2026-08-07 09:06:34
Authors
Odoo Community Association (OCA), ABF OSIELL
Maintainers
Odoo Community Association (OCA), ABF OSIELL
Committers
Víctor Martínez, Weblate, OCA-git-bot, oca-ci, Milan Topuzov, Johan Bjurstam
Odoo dependencies
odoo/odoo:
Python dependencies
None
System dependencies
None
Required by
base_user_role_company, document_page_access_group_user_role
Description
This module was written to extend the standard functionality regarding
users and groups management. It helps creating well-defined user roles
and associating them to users.

It can become very hard to maintain a large number of user profiles over
time, juggling with many technical groups. For this purpose, this module
will help you to:

> - define functional roles by aggregating low-level groups,
> - set user accounts with the predefined roles (roles are cumulative),
> - update groups of all relevant user accounts (all at once),
> - ensure that user accounts will have the groups defined in their
>   roles (nothing more, nothing less). In other words, you can not set
>   groups manually on a user as long as there is roles configured on
>   it,
> - activate/deactivate roles depending on the date (useful to plan
>   holidays, etc)
> - get a quick overview of roles and the related user accounts.

That way you make clear the different responsabilities within a company,
and are able to add and update user accounts in a scalable and reliable
way.

Code Analysis

Views touched (9)
XML IDNameModelTypeStatus
create_from_user_wizard_view Create role from user wizard.create.role.from.user form New
group_groups_into_role_wiz_view wizard.groups.into.role.wiz.view wizard.groups.into.role form New
res_groups_view_form res.groups.form - base_user_role res.groups form Inherits base.view_groups_form
view_res_users_form_inherit res.users.form.inherit res.users form Inherits base.view_users_form
view_res_users_role_form res.users.role.form res.users.role form New
view_res_users_role_search res.users.role.search res.users.role search New
view_res_users_role_tree res.users.role.list res.users.role list New
view_res_users_search_inherit res.users.search.inherit res.users search Inherits base.view_users_search
view_res_users_tree_inherit res.users tree Inherits base.view_users_tree
HTTP endpoints (0)

No HTTP endpoints found for this module.

Models touched (6)

New fields (6)
  • parent_ids Many2many → res.groups
    help='Inverse relation for the Inherits field. The groups from which this group is inheriting' string='Parents' args: 'res.groups', 'res_groups_implied_rel', 'hid', 'gid'
  • role_count Integer
    compute='_compute_role_count' args: '# User Roles'
  • role_id One2many → res.users.role
    comodel_name='res.users.role' help='Relation for the groups that represents a role' inverse_name='group_id'
  • role_ids Many2many → res.users.role
    comodel_name='res.users.role' compute='_compute_role_ids' help='Roles in which the group is involved' relation='res_groups_implied_roles_rel' string='User Roles'
  • trans_parent_ids Many2many → res.groups
    comodel_name='res.groups' compute='_compute_trans_parent_ids' recursive=True string='Parent Groups'
  • view_access Many2many
    groups='base.group_system'
Public methods (1)
  • action_view_roles(self)

New fields (3)
  • role_ids One2many → res.users.role
    comodel_name='res.users.role' compute='_compute_role_ids' compute_sudo=True groups='base.group_erp_manager' string='User Roles'
  • role_line_ids One2many → res.users.role.line
    comodel_name='res.users.role.line' default=<expr> groups='base.group_erp_manager' inverse_name='user_id' string='Role lines'
  • show_alert Boolean
    compute='_compute_show_alert'
Public methods (3)
  • create(self, vals_list)
    @api.model_create_multi
  • set_groups_from_roles(self, force=False)
    Set (replace) the groups following the roles defined on users. If no role is defined on the user, its groups are let untouched unless the `force` parameter is `True`.
  • write(self, vals)

New fields (9)
  • group_id Many2one → res.groups
    comodel_name='res.groups' ondelete='cascade' readonly=True required=True string='Associated group'
  • group_privilege_id Many2one
    help='Privilege assigned to the associated group.' readonly=False related='group_id.privilege_id' string='Associated privilege'
  • is_default Boolean
    help='When enabled, this role is assigned to newly created users by default.' string='Default on new users'
  • line_ids One2many → res.users.role.line
    comodel_name='res.users.role.line' inverse_name='role_id' string='Role lines'
  • model_access_count Integer
    compute='_compute_model_access_ids'
  • model_access_ids Many2many → ir.model.access
    comodel_name='ir.model.access' compute='_compute_model_access_ids' required=False string='Access Rights'
  • role_user_ids One2many → res.users
    comodel_name='res.users' compute='_compute_role_user_ids' string='Users list'
  • rule_ids Many2many → ir.rule
    comodel_name='ir.rule' compute='_compute_rule_ids' required=False string='Record Rules'
  • rules_count Integer
    compute='_compute_rule_ids'
Public methods (9)
  • copy(self, default=None)
  • create(self, vals_list)
    @api.model_create_multi
  • cron_update_users(self)
    @api.model
  • read(self, fields=None, load='_classic_read')
  • show_model_access_ids(self)
  • show_rule_ids(self)
  • unlink(self)
  • update_users(self)
    Update all the users concerned by the roles identified by `ids`.
  • write(self, vals)

New fields (6)
  • active Boolean
    related='user_id.active'
  • date_from Date
    args: 'From'
  • date_to Date
    args: 'To'
  • is_enabled Boolean
    compute='_compute_is_enabled' args: 'Enabled'
  • role_id Many2one → res.users.role
    comodel_name='res.users.role' ondelete='cascade' required=True string='Role'
  • user_id Many2one → res.users
    comodel_name='res.users' domain=[('id', '!=', SUPERUSER_ID)] ondelete='cascade' required=True string='User'
Public methods (1)
  • unlink(self)

New fields (2)
  • assign_to_user Boolean
    default=True args: 'Assign to user'
  • name Char
    required=True
Public methods (1)
  • create_from_user(self)

New fields (1)
  • name Char
    help='Group groups into a role and specify a name for this role' required=True
Public methods (1)
  • create_role(self)

Loading…

Loading…

Loading…

Loading…

Loading…

Loading…

Loading…

Loading…

Loading…

Loading…

Loading…