User roles
base_user_role · OCA/server-backend
OCA/server-tools 8.0–10.0 → OCA/server-backend 11.0–19.0
-
Security25/25No findings
-
Activity25/25Human commit this month
-
Required by20/254 modules depend on it
-
Maturity25/25In 12 Odoo series since 8.0
Heuristic over the facts below, not an audit · How it's computed
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.
Dependencies
- Odoo dependencies
-
odoo/odoo:- base
- Python dependencies
- None
- System dependencies
- None
- Required by
- base_user_role_activity, base_user_role_company, base_user_role_history, document_page_access_group_user_role
Code analysis
Extracted from the source by best-effort static analysis (no code is executed); details may be incomplete.
Views touched 10
| XML ID | Name | Model | Type | Status |
|---|---|---|---|---|
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_add_users_wizard |
role.add.users.wizard.form | role.add.users.wizard | form | New |
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 7
-
parent_idsMany2many → res.groupshelp='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_countIntegercompute='_compute_role_count' args: '# User Roles' -
role_idOne2many → res.users.rolecomodel_name='res.users.role'help='Relation for the groups that represents a role'inverse_name='group_id' -
role_idsMany2many → res.users.rolecomodel_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_idsMany2many → res.groupscomodel_name='res.groups'compute='_compute_trans_parent_ids'recursive=Truestring='Parent Groups' -
view_accessMany2manygroups='base.group_system'
-
action_view_roles(self)
-
role_line_idsOne2many → res.users.role.linecomodel_name='res.users.role.line'default=<expr>groups='base.group_erp_manager'inverse_name='user_id'string='Role lines' -
show_alertBooleancompute='_compute_show_alert' -
user_role_idsOne2many → res.users.rolecomodel_name='res.users.role'compute='_compute_user_role_ids'compute_sudo=Truegroups='base.group_erp_manager'string='Roles'
-
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)
-
group_idMany2one → res.groupscomodel_name='res.groups'ondelete='cascade'readonly=Truerequired=Truestring='Associated group' -
group_privilege_idMany2onehelp='Privilege assigned to the associated group.'readonly=Falserelated='group_id.privilege_id'string='Associated privilege' -
is_defaultBooleanhelp='When enabled, this role is assigned to newly created users by default.'string='Default on new users' -
line_idsOne2many → res.users.role.linecomodel_name='res.users.role.line'inverse_name='role_id'string='Role lines' -
model_access_countIntegercompute='_compute_model_access_ids' -
model_access_idsMany2many → ir.model.accesscomodel_name='ir.model.access'compute='_compute_model_access_ids'required=Falsestring='Access Rights' -
role_user_idsOne2many → res.userscomodel_name='res.users'compute='_compute_role_user_ids'search='_search_role_user_ids'string='Users list' -
rule_idsMany2many → ir.rulecomodel_name='ir.rule'compute='_compute_rule_ids'required=Falsestring='Record Rules' -
rules_countIntegercompute='_compute_rule_ids' -
sequenceIntegerdefault=10
-
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)
-
activeBooleanrelated='user_id.active' -
date_fromDateargs: 'From' -
date_toDateargs: 'To' -
is_enabledBooleancompute='_compute_is_enabled' args: 'Enabled' -
nameCharrelated='role_id.name' -
role_idMany2one → res.users.rolecomodel_name='res.users.role'ondelete='cascade'required=True -
sequenceIntegerrelated='role_id.sequence' -
user_idMany2one → res.userscomodel_name='res.users'domain=[('id', '!=', SUPERUSER_ID)]ondelete='cascade'required=True
-
unlink(self)
-
date_fromDateargs: 'From' -
date_toDateargs: 'To' -
role_idMany2one → res.users.rolecomodel_name='res.users.role'ondelete='cascade'required=True -
user_idsMany2many → res.userscomodel_name='res.users'required=Truestring='Users'
-
action_add_users(self)
-
assign_to_userBooleandefault=True args: 'Assign to user' -
nameCharrequired=True
-
create_from_user(self)
-
nameCharhelp='Group groups into a role and specify a name for this role'required=True
-
create_role(self)
Loading…
Loading…
Loading…
Loading…
Loading…
Loading…
Loading…
Loading…
Loading…
Loading…
Loading…
Loading…