Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
162 commits
Select commit Hold shift + click to select a range
d681476
8.0 - New module 'base_user_role' to manage user roles efficiently (#…
sebalix Dec 9, 2016
ba7fa35
base_user_role: display roles as first tab in user form
sbidoul Dec 10, 2016
129bc39
base_user_role - Set a default category to associated groups
sebalix Dec 10, 2016
dbdb3de
[MIG] base_user_role: Port to 10.0
Jan 2, 2017
e9f3411
[FIX] Crash in base_user_role when role_id is not set on res.users.ro…
alexis-via Jun 12, 2017
5dca1be
[10.0][FIX] User group not updating when removing a user from the rol…
benwillig Aug 11, 2017
8c22198
[MIG] base_user_role: Migration to 11.0
Nov 19, 2017
10e48fd
[FIX+IMP] base_user_role: Several things:
sebalix Sep 21, 2017
1ff1116
[MIG] Update test cases for testing (unlink role and role line) to ne…
Nov 23, 2017
449ab8a
[IMP] Use default user to define default roles to create for a new user
benwillig Oct 12, 2017
9c9e7a4
[UPD] Update base_user_role.pot
oca-travis Aug 30, 2018
721ff9f
Translated using Weblate (Danish)
hhgabelgaard Aug 30, 2018
3fb9ddb
[MIG] base_user_role: Migration to 12.0
Oct 14, 2018
033ca5e
[UPD] README.rst
OCA-git-bot Nov 19, 2018
c5b4f40
[UPD] Update base_user_role.pot
oca-travis Nov 19, 2018
0708391
Update translation files
oca-transbot Nov 25, 2018
785a2ba
[UPD] README.rst
OCA-git-bot Dec 2, 2018
e01a7c1
[12.0][FIX] readme
HviorForgeFlow Dec 11, 2018
44fcb7d
[UPD] README.rst
OCA-git-bot Feb 11, 2019
4e88ea5
[MIG] base_import_match: Migration to 12.0
ernestotejeda Feb 8, 2019
a91d402
[base_user_role] improve performance by only adding/removing from a user
JordiBForgeFlow Jan 2, 2019
aed7811
[UPD] README.rst
OCA-git-bot Jul 29, 2019
2034325
[10.0][UPD] base_user_role: Disabled Administrator user selection in …
artux404 Jun 12, 2018
6a0c33b
Switch AGPL to LGPL license
elicoidal Dec 29, 2018
40e98cb
Revert "[FIX] Crash in base_user_role when role_id is not set on res.…
Jan 29, 2019
98f5c4a
Make user_id and role_id required in base_user_role_line
Jan 29, 2019
a8e21d4
[IMP] make base_user_role_line company dependent
Jan 29, 2019
8bae23e
FIX check_company
Feb 14, 2019
0858fd3
[MIG] base_user_role: Migration to 13.0
sebalix Oct 1, 2019
f677daa
[IMP] base_user_role: black, isort
sebalix Dec 16, 2019
788b1b4
[UPD] Update base_user_role.pot
oca-travis Jan 30, 2020
1ed5ae6
[UPD] README.rst
OCA-git-bot Jan 30, 2020
850cd91
Update translation files
oca-transbot Jan 31, 2020
04143be
Translated using Weblate (Spanish (Mexico))
alan196 Feb 15, 2020
ce72ee8
pre-commit update
OCA-git-bot Mar 14, 2020
04b16fd
Translated using Weblate (French)
houzefa-abba Sep 28, 2020
d47e394
[FIX] base_user_role: text on role Internal Notes was not saved
dreispt Jan 31, 2022
cb3fba3
[13.0][FIX]base_user_role: Add compute_sudo
GuillemCForgeFlow Apr 26, 2022
5d9855c
[13.0][FIX]base_user_role: Show active users on Users page
GuillemCForgeFlow May 25, 2022
d82df5e
[UPD] Update base_user_role.pot
Aug 11, 2022
421c9bf
base_user_role 15.0.0.2.0
OCA-git-bot Aug 11, 2022
6e7744f
Update translation files
oca-transbot Aug 11, 2022
e07dd6e
base_user_role 15.0.0.2.1
OCA-git-bot Aug 11, 2022
91246e2
[IMP] base_user_role: black, isort, prettier
apineux Aug 16, 2022
04c5939
[MIG] base_user_role: Migration to 16.0
apineux Aug 16, 2022
02c07c8
[UPD] Update base_user_role.pot
Oct 18, 2022
ea32a44
[UPD] README.rst
OCA-git-bot Oct 18, 2022
3f0a24a
[IMP] base_user_role show rules and access
Kev-Roche Jun 27, 2022
3c49f26
Update translation files
weblate Oct 18, 2022
2620632
[UPD] Update base_user_role.pot
Oct 20, 2022
d1ac92b
[MIG] base_user_role: Migration to 14.0
alan196 Oct 12, 2020
03bad4f
[UPD] Update base_user_role.pot
oca-travis Dec 16, 2020
0956486
[IMP] Fix edition of role
sebastienbeau Dec 20, 2020
bb2da79
[IMP] base_user_role: Adding a new tab for user comments in roles form.
HaraldPanten Dec 21, 2020
ba3a31b
[UPD] Update base_user_role.pot
oca-travis Dec 30, 2020
cfe7d35
[UPD] README.rst
OCA-git-bot Dec 30, 2020
a217271
base_user_role 14.0.1.1.0
OCA-git-bot Dec 30, 2020
a4f2016
Update translation files
oca-transbot Dec 30, 2020
491127c
[FIX] base_user_role: remove multicompany functionality
kevinkhao Jan 25, 2021
1f14cd9
[UPD] Update base_user_role.pot
oca-travis Jan 27, 2021
579f1fe
base_user_role 14.0.2.0.0
OCA-git-bot Jan 27, 2021
f65de88
Update translation files
oca-transbot Jan 27, 2021
d0765b2
[IMP] base_user_role: UX improvements
kevinkhao Jan 25, 2021
e889179
[UPD] Update base_user_role.pot
oca-travis Jan 28, 2021
fef4eab
[UPD] README.rst
OCA-git-bot Jan 28, 2021
e7769b6
base_user_role 14.0.2.1.0
OCA-git-bot Jan 28, 2021
0d0dd71
Update translation files
oca-transbot Jan 28, 2021
098bf3c
base_user_role 14.0.2.1.1
OCA-git-bot Feb 12, 2021
83fba2d
Translated using Weblate (Spanish)
anasuarez1 Mar 16, 2021
cffd9ef
Translated using Weblate (Vietnamese)
minhdc Sep 25, 2021
322d979
[MIG] base_user_role: Migration to 15.0
Nov 11, 2021
edee835
[UPD] Update base_user_role.pot
Nov 27, 2021
b85ef6f
[UPD] README.rst
OCA-git-bot Nov 27, 2021
fd867f5
Translated using Weblate (Catalan)
pablontura Apr 13, 2022
1a07020
FIX base_user_role: use ``sudo()`` in ``user_ids`` compute
SilvioC2C May 26, 2022
8048748
FIX base_user_role: update tests
SilvioC2C May 26, 2022
5fc84f1
base_user_role 16.0.1.1.0
OCA-git-bot Oct 20, 2022
13138af
Update translation files
weblate Oct 20, 2022
d03aa0b
[DOC] base_user_role: set development status to 'Production/Stable'
sebalix Oct 18, 2022
0f9cd3f
[UPD] README.rst
OCA-git-bot Oct 20, 2022
f867da4
base_user_role 16.0.1.1.1
OCA-git-bot Oct 20, 2022
e458168
[UPD] Update base_user_role.pot
Jan 26, 2023
a4c99fa
Update translation files
weblate Jan 26, 2023
71d4f0a
Add "Create role from user" feature
gpothier Jun 20, 2023
09a5cab
Fix formatting according to pre-commit hook
gpothier Jun 21, 2023
0dad0b4
Make name field required
gpothier Jun 21, 2023
3756917
Simplify wizard name
gpothier Jun 21, 2023
33e8f00
Undo changes to README and put them in the files in the readme direct…
gpothier Jun 21, 2023
b22b784
Fix model name change in views
gpothier Jun 21, 2023
14e1ba8
Add test for the create role from user wizard
gpothier Jun 21, 2023
83c1ba7
Use kwargs in with_context, as per pre-commit recommendation
gpothier Jun 21, 2023
c03ef82
Translated using Weblate (Italian)
francesco-ooops Jun 22, 2023
e4677d7
[UPD] Update base_user_role.pot
Jun 24, 2023
408f659
[UPD] README.rst
OCA-git-bot Jun 24, 2023
d400290
base_user_role 16.0.1.2.0
OCA-git-bot Jun 24, 2023
9267d96
Update translation files
weblate Jun 24, 2023
9c93e47
[FIX] base_user_role: filter domain for user role search
JordiMForgeFlow Jul 6, 2023
2b10dff
base_user_role 16.0.1.2.1
OCA-git-bot Jul 10, 2023
9bb6702
Translated using Weblate (Italian)
francesco-ooops Jul 11, 2023
fd1ac5f
Translated using Weblate (French)
ypapouin Jul 17, 2023
0de50d6
Translated using Weblate (Spanish)
Ivorra78 Aug 25, 2023
9f84551
[IMP]base_user_role: Groups-roles navigation
GuillemCForgeFlow Apr 19, 2022
065b70b
[UPD] Update base_user_role.pot
Jun 20, 2022
756a497
[UPD] README.rst
OCA-git-bot Jun 20, 2022
b95aea8
base_user_role 15.0.0.1.0
OCA-git-bot Jun 20, 2022
cc21ada
Update translation files
oca-transbot Jun 20, 2022
f709c18
[15.0][FIX] UserWarning: Field res.groups.trans_parent_ids should be …
elmeriniemela Jul 11, 2022
6a6fdd6
[FIX] base_user_role: tests - include `trans_implied_ids`
kirca Aug 8, 2022
e3ccbbd
base_user_role 15.0.0.1.1
OCA-git-bot Aug 11, 2022
49ec3bd
Translated using Weblate (Spanish)
kikopeiro Aug 28, 2023
0fe1bf7
Translated using Weblate (Portuguese)
pedrocs-exo Aug 31, 2023
8450a24
[UPD] README.rst
OCA-git-bot Sep 3, 2023
9644d30
Translated using Weblate (Italian)
francesco-ooops Sep 7, 2023
899ddc8
base_user_role - add (copy) in order to allow the duplicate
jdidderen Sep 11, 2023
5455dbf
[UPD] Update base_user_role.pot
Sep 11, 2023
7b0b957
base_user_role 16.0.1.2.2
OCA-git-bot Sep 11, 2023
05104eb
[UPD] README.rst
OCA-git-bot Sep 11, 2023
6f9f5e5
Update translation files
weblate Sep 20, 2023
c9b0794
Translated using Weblate (Spanish)
Ivorra78 Oct 3, 2023
457ca04
[IMP] base_user_role: pre-commit stuff
rven Dec 13, 2023
3e80621
[MIG] base_user_role: Migration to 17.0
rven Dec 13, 2023
93238b6
[15.0][IMP] base_user_role: Add role_ids column to tree view.
amh-mw Nov 15, 2023
8c2de84
[15.0][IMP] base_user_role: action to group groups into a role
ArnauCForgeFlow Jan 26, 2024
9732684
[UPD] Update base_user_role.pot
Feb 9, 2024
874b6ce
[BOT] post-merge updates
OCA-git-bot Feb 9, 2024
e47e078
Update translation files
weblate Feb 9, 2024
5267f05
Translated using Weblate (Spanish)
Ivorra78 Feb 14, 2024
6c124d8
Translated using Weblate (Italian)
mymage Feb 15, 2024
4557e70
Translated using Weblate (Italian)
mymage Mar 6, 2024
8594cdf
[FIX] base_user_role: Set group on access_wizard_groups_into_role
hwangh95 Apr 4, 2024
81ea4ea
[BOT] post-merge updates
OCA-git-bot Apr 9, 2024
76e6793
Translated using Weblate (Swedish)
jakobkrabbe Jun 12, 2024
1dcfe9b
[IMP] base_user_role: Adding alert in user when role is used
jesusramoneda Jun 7, 2023
8bc1081
[UPD] Update base_user_role.pot
Jul 10, 2024
12b75a7
[BOT] post-merge updates
OCA-git-bot Jul 10, 2024
27e39b9
Update translation files
weblate Jul 10, 2024
1fafce1
Translated using Weblate (Italian)
mymage Jul 15, 2024
b325ea1
[FIX] base_user_role: prevent crash when using 'res.users' (x2m) fiel…
Jul 29, 2024
f03a075
[BOT] post-merge updates
OCA-git-bot Jul 31, 2024
663c431
[IMP] base_user_role: pre-commit stuff
BertVGroenendael Oct 21, 2024
8a5f37d
[IMP] base_user_role: pre-commit stuff
BertVGroenendael Oct 21, 2024
74f4ba7
[18.0][MIG] base_user_role
BertVGroenendael Oct 21, 2024
fcc38e8
[UPD] Update base_user_role.pot
Nov 27, 2024
c784aa8
[BOT] post-merge updates
OCA-git-bot Nov 27, 2024
377de68
Update translation files
weblate Nov 27, 2024
ebf92fb
Translated using Weblate (Italian)
mymage Nov 28, 2024
28a873d
[FIX] base_user_role: Improve tests resiliency
yajo Nov 13, 2019
c050e4b
[IMP] base_user_role: Improve tests to avoid false errors (ids in dif…
victoralmau Feb 1, 2024
5921dc5
[BOT] post-merge updates
OCA-git-bot Jan 29, 2025
4f471aa
[IMP] base_user_role - add path in act_window to fit with new url logic
jdidderen Jan 27, 2025
c047ae9
[BOT] post-merge updates
OCA-git-bot Mar 5, 2025
e14b434
Translated using Weblate (Turkish)
bo-eska May 26, 2025
b0d673c
[FIX] base_user_role: fix field name ambiguity
StefanRijnhart Aug 12, 2025
c7c47c2
[UPD] Update base_user_role.pot
Aug 13, 2025
234c4ca
[BOT] post-merge updates
OCA-git-bot Aug 13, 2025
dcac019
Update translation files
weblate Aug 13, 2025
67a4d23
Translated using Weblate (Turkish)
bo-eska Aug 14, 2025
3945703
Translated using Weblate (Italian)
mymage Aug 16, 2025
6c42808
[19.0][MIG] base_user_role: Migration to 19.0
Oct 9, 2025
6ba1bf6
[IMP] pre-commit auto-fixes
Oct 9, 2025
105096b
[19.0][MIG] base_user_role: use fields.Command for x2many ops
Nov 9, 2025
390affc
[19.0][MIG] base_user_role: default roles via is_default
Nov 9, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
179 changes: 179 additions & 0 deletions base_user_role/README.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,179 @@
.. image:: https://odoo-community.org/readme-banner-image
:target: https://odoo-community.org/get-involved?utm_source=readme
:alt: Odoo Community Association

==========
User roles
==========

..
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! This file is generated by oca-gen-addon-readme !!
!! changes will be overwritten. !!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! source digest: sha256:557120cfbcbe8bb63ab06f552d5625f00137aabea937a34662888d444a61d3e5
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

.. |badge1| image:: https://img.shields.io/badge/maturity-Production%2FStable-green.png
:target: https://odoo-community.org/page/development-status
:alt: Production/Stable
.. |badge2| image:: https://img.shields.io/badge/license-LGPL--3-blue.png
:target: http://www.gnu.org/licenses/lgpl-3.0-standalone.html
:alt: License: LGPL-3
.. |badge3| image:: https://img.shields.io/badge/github-OCA%2Fserver--backend-lightgray.png?logo=github
:target: https://github.com/OCA/server-backend/tree/19.0/base_user_role
:alt: OCA/server-backend
.. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png
:target: https://translation.odoo-community.org/projects/server-backend-19-0/server-backend-19-0-base_user_role
:alt: Translate me on Weblate
.. |badge5| image:: https://img.shields.io/badge/runboat-Try%20me-875A7B.png
:target: https://runboat.odoo-community.org/builds?repo=OCA/server-backend&target_branch=19.0
:alt: Try me on Runboat

|badge1| |badge2| |badge3| |badge4| |badge5|

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.

**Table of contents**

.. contents::
:local:

Configuration
=============

To configure this module, you need to go to *Settings / Users / Roles*,
and create a new role. From there, you can add groups to compose your
role, and then associate users to it.

You can also define default roles for a new user by editing the user
called "Default User".

Roles:

|image1|

Add groups:

|image2|

Add users (with dates or not):

|image3|

Instead of creating roles from scratch, it is possible to create a role
based on the groups of an existing user: select or open the user and
choose "Create role from user" in the action menu.

.. |image1| image:: https://raw.githubusercontent.com/OCA/server-backend/16.0/base_user_role/static/description/roles.png
.. |image2| image:: https://raw.githubusercontent.com/OCA/server-backend/16.0/base_user_role/static/description/role_groups.png
.. |image3| image:: https://raw.githubusercontent.com/OCA/server-backend/16.0/base_user_role/static/description/role_users.png

Usage
=====

To use this module, you need to:

1. Go to Configuration / Users / Users choose user and set Roles:

|image|

.. |image| image:: https://raw.githubusercontent.com/OCA/server-backend/base_user_role/static/description/user_form.png

Bug Tracker
===========

Bugs are tracked on `GitHub Issues <https://github.com/OCA/server-backend/issues>`_.
In case of trouble, please check there if your issue has already been reported.
If you spotted it first, help us to smash it by providing a detailed and welcomed
`feedback <https://github.com/OCA/server-backend/issues/new?body=module:%20base_user_role%0Aversion:%2019.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**>`_.

Do not contact contributors directly about support or help with technical issues.

Credits
=======

Authors
-------

* ABF OSIELL

Contributors
------------

- Sébastien Alix <sebastien.alix@camptocamp.com>
- Duc, Dao Dong <duc.dd@komit-consulting.com>
(https://komit-consulting.com)
- Jean-Charles Drubay <jc@komit-consulting.com>
(https://komit-consulting.com)
- Alan Ramos <alan.ramos@jarsa.com.mx> (https://www.jarsa.com.mx)
- Harald Panten <harald.panten@sygel.es>
- Kevin Khao <kevin.khao@akretion.com>
- Tatiana Deribina <tatiana.deribina@sprintit.fi> (https://sprintit.fi)
- Guillem Casassas <guillem.casassas@forgeflow.com>
- Guillaume Pothier <gpothier@caligrafix.cl>

Do not contact contributors directly about support or help with
technical issues.

Other credits
-------------

Images
~~~~~~

- Oxygen Team:
`Icon <http://www.iconarchive.com/show/oxygen-icons-by-oxygen-icons.org/Actions-user-group-new-icon.html>`__
(LGPL)

Maintainers
-----------

This module is maintained by the OCA.

.. image:: https://odoo-community.org/logo.png
:alt: Odoo Community Association
:target: https://odoo-community.org

OCA, or the Odoo Community Association, is a nonprofit organization whose
mission is to support the collaborative development of Odoo features and
promote its widespread use.

.. |maintainer-sebalix| image:: https://github.com/sebalix.png?size=40px
:target: https://github.com/sebalix
:alt: sebalix
.. |maintainer-jcdrubay| image:: https://github.com/jcdrubay.png?size=40px
:target: https://github.com/jcdrubay
:alt: jcdrubay
.. |maintainer-novawish| image:: https://github.com/novawish.png?size=40px
:target: https://github.com/novawish
:alt: novawish

Current `maintainers <https://odoo-community.org/page/maintainer-role>`__:

|maintainer-sebalix| |maintainer-jcdrubay| |maintainer-novawish|

This module is part of the `OCA/server-backend <https://github.com/OCA/server-backend/tree/19.0/base_user_role>`_ project on GitHub.

You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.
2 changes: 2 additions & 0 deletions base_user_role/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
from . import models
from . import wizards
26 changes: 26 additions & 0 deletions base_user_role/__manifest__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
# Copyright 2014 ABF OSIELL <http://osiell.com>
# License LGPL-3.0 or later (http://www.gnu.org/licenses/lgpl).


{
"name": "User roles",
"version": "19.0.1.0.0",
"category": "Tools",
"author": "ABF OSIELL, Odoo Community Association (OCA)",
"license": "LGPL-3",
"development_status": "Production/Stable",
"maintainers": ["sebalix", "jcdrubay", "novawish"],
"website": "https://github.com/OCA/server-backend",
"depends": ["base"],
"data": [
"security/ir.model.access.csv",
"data/ir_cron.xml",
"data/ir_module_category.xml",
"views/role.xml",
"views/user.xml",
"views/group.xml",
"wizards/create_from_user.xml",
"wizards/wizard_groups_into_role.xml",
],
"installable": True,
}
15 changes: 15 additions & 0 deletions base_user_role/data/ir_cron.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
<?xml version="1.0" encoding="utf-8" ?>
<!-- Copyright 2016 ABF OSIELL <http://osiell.com>
License LGPL-3.0 or later (http://www.gnu.org/licenses/lgpl).
-->
<odoo noupdate="1">
<record model="ir.cron" id="cron_update_users">
<field name='name'>Update user roles</field>
<field name='interval_number'>3</field>
<field name='interval_type'>hours</field>
<field name="active">True</field>
<field name="model_id" ref="base_user_role.model_res_users_role" />
<field name="state">code</field>
<field name="code">model.cron_update_users()</field>
</record>
</odoo>
15 changes: 15 additions & 0 deletions base_user_role/data/ir_module_category.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
<?xml version="1.0" encoding="utf-8" ?>
<!-- Copyright 2016 ABF OSIELL <http://osiell.com>
License LGPL-3.0 or later (http://www.gnu.org/licenses/lgpl).
-->
<odoo>
<!--
This module category aims to be linked to role/group you create in your own
module (field 'res.groups.category_id').
By doing this you'll have the section 'User roles' in the "Access rights" tab
on the user form which will regroup all roles/groups for a better visibility.
-->
<record model="ir.module.category" id="ir_module_category_role">
<field name='name'>User roles</field>
</record>
</odoo>
Loading