Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
97 changes: 97 additions & 0 deletions dms_user_role/README.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,97 @@
=============
DMS User Role
=============

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

.. |badge1| image:: https://img.shields.io/badge/maturity-Beta-yellow.png
:target: https://odoo-community.org/page/development-status
:alt: Beta
.. |badge2| image:: https://img.shields.io/badge/licence-AGPL--3-blue.png
:target: http://www.gnu.org/licenses/agpl-3.0-standalone.html
:alt: License: AGPL-3
.. |badge3| image:: https://img.shields.io/badge/github-OCA%2Fdms-lightgray.png?logo=github
:target: https://github.com/OCA/dms/tree/18.0/dms_user_role
:alt: OCA/dms
.. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png
:target: https://translation.odoo-community.org/projects/dms-18-0/dms-18-0-dms_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/dms&target_branch=18.0
:alt: Try me on Runboat

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

Use of roles (module base_user_role) in DMS access groups.

**Table of contents**

.. contents::
:local:

Usage
=====

1. Go to Settings / Users & Companies / Roles and create a new one.
2. Go to Documents / Configuration / Access groups and create or edit
one.
3. Set in the "Roles" tab the one we have just created.
4. Go back to the role, edit it and add an extra user.
5. The extra user will have been added in the "Users" tab.

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

Bugs are tracked on `GitHub Issues <https://github.com/OCA/dms/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/dms/issues/new?body=module:%20dms_user_role%0Aversion:%2018.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
-------

* Tecnativa

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

- `Tecnativa <https://www.tecnativa.com>`__:

- Víctor Martínez
- Pedro M. Baeza

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-victoralmau| image:: https://github.com/victoralmau.png?size=40px
:target: https://github.com/victoralmau
:alt: victoralmau

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

|maintainer-victoralmau|

This module is part of the `OCA/dms <https://github.com/OCA/dms/tree/18.0/dms_user_role>`_ project on GitHub.

You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.
3 changes: 3 additions & 0 deletions dms_user_role/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl.html).

from . import models
16 changes: 16 additions & 0 deletions dms_user_role/__manifest__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# Copyright 2024 Tecnativa - Víctor Martínez
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).
{
"name": "DMS User Role",
"version": "19.0.1.0.0",
"category": "Document Management",
"website": "https://github.com/OCA/dms",
"author": "Tecnativa, Odoo Community Association (OCA)",
"license": "AGPL-3",
"depends": ["dms", "base_user_role"],
"installable": True,
"data": [
"views/dms_access_group_views.xml",
],
"maintainers": ["victoralmau"],
}
27 changes: 27 additions & 0 deletions dms_user_role/i18n/ar.po
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * dms_user_role
#
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 18.0\n"
"Report-Msgid-Bugs-To: \n"
"Last-Translator: Automatically generated\n"
"Language-Team: none\n"
"Language: ar\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: \n"
"Plural-Forms: nplurals=6; plural=n==0 ? 0 : n==1 ? 1 : n==2 ? 2 : n%100>=3 "
"&& n%100<=10 ? 3 : n%100>=11 ? 4 : 5;\n"

#. module: dms_user_role
#: model:ir.model,name:dms_user_role.model_dms_access_group
msgid "Record Access Groups"
msgstr ""

#. module: dms_user_role
#: model:ir.model.fields,field_description:dms_user_role.field_dms_access_group__role_ids
#: model_terms:ir.ui.view,arch_db:dms_user_role.view_dms_access_groups_form
msgid "Roles"
msgstr ""
25 changes: 25 additions & 0 deletions dms_user_role/i18n/dms_user_role.pot
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * dms_user_role
#
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 18.0\n"
"Report-Msgid-Bugs-To: \n"
"Last-Translator: \n"
"Language-Team: \n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: \n"
"Plural-Forms: \n"

#. module: dms_user_role
#: model:ir.model,name:dms_user_role.model_dms_access_group
msgid "Record Access Groups"
msgstr ""

#. module: dms_user_role
#: model:ir.model.fields,field_description:dms_user_role.field_dms_access_group__role_ids
#: model_terms:ir.ui.view,arch_db:dms_user_role.view_dms_access_groups_form
msgid "Roles"
msgstr ""
29 changes: 29 additions & 0 deletions dms_user_role/i18n/es.po
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * dms_user_role
#
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 15.0\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2024-03-05 10:23+0000\n"
"PO-Revision-Date: 2024-10-08 17:06+0000\n"
"Last-Translator: Víctor Martínez <victor.martinez@tecnativa.com>\n"
"Language-Team: \n"
"Language: es\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: \n"
"Plural-Forms: nplurals=2; plural=n != 1;\n"
"X-Generator: Weblate 5.6.2\n"

#. module: dms_user_role
#: model:ir.model,name:dms_user_role.model_dms_access_group
msgid "Record Access Groups"
msgstr "Grupos de acceso de registro"

#. module: dms_user_role
#: model:ir.model.fields,field_description:dms_user_role.field_dms_access_group__role_ids
#: model_terms:ir.ui.view,arch_db:dms_user_role.view_dms_access_groups_form
msgid "Roles"
msgstr "Roles"
28 changes: 28 additions & 0 deletions dms_user_role/i18n/it.po
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * dms_user_role
#
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 16.0\n"
"Report-Msgid-Bugs-To: \n"
"PO-Revision-Date: 2024-04-04 16:35+0000\n"
"Last-Translator: mymage <stefano.consolaro@mymage.it>\n"
"Language-Team: none\n"
"Language: it\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: \n"
"Plural-Forms: nplurals=2; plural=n != 1;\n"
"X-Generator: Weblate 4.17\n"

#. module: dms_user_role
#: model:ir.model,name:dms_user_role.model_dms_access_group
msgid "Record Access Groups"
msgstr "Gruppi di accesso al record"

#. module: dms_user_role
#: model:ir.model.fields,field_description:dms_user_role.field_dms_access_group__role_ids
#: model_terms:ir.ui.view,arch_db:dms_user_role.view_dms_access_groups_form
msgid "Roles"
msgstr "Ruoli"
29 changes: 29 additions & 0 deletions dms_user_role/i18n/sl.po
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * dms_user_role
#
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 18.0\n"
"Report-Msgid-Bugs-To: \n"
"PO-Revision-Date: 2026-06-09 11:46+0000\n"
"Last-Translator: Matjaz Mozetic <matjaz@luxim.si>\n"
"Language-Team: none\n"
"Language: sl\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: \n"
"Plural-Forms: nplurals=4; plural=n%100==1 ? 0 : n%100==2 ? 1 : n%100==3 || "
"n%100==4 ? 2 : 3;\n"
"X-Generator: Weblate 5.15.2\n"

#. module: dms_user_role
#: model:ir.model,name:dms_user_role.model_dms_access_group
msgid "Record Access Groups"
msgstr "Skupine dostopa do zapisov"

#. module: dms_user_role
#: model:ir.model.fields,field_description:dms_user_role.field_dms_access_group__role_ids
#: model_terms:ir.ui.view,arch_db:dms_user_role.view_dms_access_groups_form
msgid "Roles"
msgstr "Vloge"
28 changes: 28 additions & 0 deletions dms_user_role/i18n/sv.po
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * dms_user_role
#
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 18.0\n"
"Report-Msgid-Bugs-To: \n"
"PO-Revision-Date: 2025-09-19 13:31+0000\n"
"Last-Translator: jakobkrabbe <jakob@syscare.se>\n"
"Language-Team: none\n"
"Language: sv\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: \n"
"Plural-Forms: nplurals=2; plural=n != 1;\n"
"X-Generator: Weblate 5.10.4\n"

#. module: dms_user_role
#: model:ir.model,name:dms_user_role.model_dms_access_group
msgid "Record Access Groups"
msgstr "Grupper för åtkomst till register"

#. module: dms_user_role
#: model:ir.model.fields,field_description:dms_user_role.field_dms_access_group__role_ids
#: model_terms:ir.ui.view,arch_db:dms_user_role.view_dms_access_groups_form
msgid "Roles"
msgstr "Roller"
3 changes: 3 additions & 0 deletions dms_user_role/models/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).

from . import dms_access_group
26 changes: 26 additions & 0 deletions dms_user_role/models/dms_access_group.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
# Copyright 2024 Tecnativa - Víctor Martínez
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).

from odoo import api, fields, models


class DmsAccessGroup(models.Model):
_inherit = "dms.access.group"

role_ids = fields.Many2many(
comodel_name="res.users.role",
relation="dms_access_group_user_roles_rel",
column1="gid",
column2="rid",
string="Roles",
)

@api.depends("role_ids", "role_ids.users")
def _compute_users(self):
"""Add the corresponding depends and the users of the roles."""
res = super()._compute_users()
for record in self.filtered("role_ids"):
users = record.users
users |= record.mapped("role_ids.users")
record.update({"users": users, "count_users": len(users)})
return res
3 changes: 3 additions & 0 deletions dms_user_role/pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[build-system]
requires = ["whool"]
build-backend = "whool.buildapi"
3 changes: 3 additions & 0 deletions dms_user_role/readme/CONTRIBUTORS.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
- [Tecnativa](https://www.tecnativa.com):
- Víctor Martínez
- Pedro M. Baeza
1 change: 1 addition & 0 deletions dms_user_role/readme/DESCRIPTION.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Use of roles (module base_user_role) in DMS access groups.
6 changes: 6 additions & 0 deletions dms_user_role/readme/USAGE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
1. Go to Settings / Users & Companies / Roles and create a new one.
2. Go to Documents / Configuration / Access groups and create or edit
one.
3. Set in the "Roles" tab the one we have just created.
4. Go back to the role, edit it and add an extra user.
5. The extra user will have been added in the "Users" tab.
Binary file added dms_user_role/static/description/icon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Loading