From 1b1ef44d481f702f294274b8279b6f624b029b11 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=C3=ADctor=20Mart=C3=ADnez?= Date: Tue, 5 Mar 2024 10:45:22 +0100 Subject: [PATCH 01/15] [ADD] dms_user_role: New module TT48182 [UPD] Update dms_user_role.pot --- dms_user_role/README.rst | 96 ++++ dms_user_role/__init__.py | 3 + dms_user_role/__manifest__.py | 16 + dms_user_role/i18n/dms_user_role.pot | 30 ++ dms_user_role/i18n/es.po | 27 ++ dms_user_role/models/__init__.py | 3 + dms_user_role/models/dms_access_group.py | 26 ++ dms_user_role/readme/CONTRIBUTORS.rst | 4 + dms_user_role/readme/DESCRIPTION.rst | 1 + dms_user_role/readme/USAGE.rst | 5 + dms_user_role/static/description/icon.png | Bin 0 -> 7197 bytes dms_user_role/static/description/index.html | 438 ++++++++++++++++++ dms_user_role/tests/__init__.py | 3 + dms_user_role/tests/test_dms_user_role.py | 60 +++ .../views/dms_access_group_views.xml | 21 + 15 files changed, 733 insertions(+) create mode 100644 dms_user_role/README.rst create mode 100644 dms_user_role/__init__.py create mode 100644 dms_user_role/__manifest__.py create mode 100644 dms_user_role/i18n/dms_user_role.pot create mode 100644 dms_user_role/i18n/es.po create mode 100644 dms_user_role/models/__init__.py create mode 100644 dms_user_role/models/dms_access_group.py create mode 100644 dms_user_role/readme/CONTRIBUTORS.rst create mode 100644 dms_user_role/readme/DESCRIPTION.rst create mode 100644 dms_user_role/readme/USAGE.rst create mode 100644 dms_user_role/static/description/icon.png create mode 100644 dms_user_role/static/description/index.html create mode 100644 dms_user_role/tests/__init__.py create mode 100644 dms_user_role/tests/test_dms_user_role.py create mode 100644 dms_user_role/views/dms_access_group_views.xml diff --git a/dms_user_role/README.rst b/dms_user_role/README.rst new file mode 100644 index 000000000..4a297d02f --- /dev/null +++ b/dms_user_role/README.rst @@ -0,0 +1,96 @@ +============= +DMS User Role +============= + +.. + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + !! This file is generated by oca-gen-addon-readme !! + !! changes will be overwritten. !! + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + !! source digest: sha256:b615f401d42710400a757a6835590ef3cc9f8a80f4e5704b36e7b12a260c4eb8 + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + +.. |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/15.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-15-0/dms-15-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=15.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 +===== + +#. Go to `Settins / Users & Companies / Roles` and create a new one. +#. Go to `Documents / Configuration / Access groups` and create or edit one. +#. Set in the "Roles" tab the one we have just created. +#. Go back to the role, edit it and add an extra user. +#. The extra user will have been added in the "Users" tab. + +Bug Tracker +=========== + +Bugs are tracked on `GitHub 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 `_. + +Do not contact contributors directly about support or help with technical issues. + +Credits +======= + +Authors +~~~~~~~ + +* Tecnativa + +Contributors +~~~~~~~~~~~~ + +* `Tecnativa `_: + + * 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 `__: + +|maintainer-victoralmau| + +This module is part of the `OCA/dms `_ project on GitHub. + +You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute. diff --git a/dms_user_role/__init__.py b/dms_user_role/__init__.py new file mode 100644 index 000000000..4b76c7b2d --- /dev/null +++ b/dms_user_role/__init__.py @@ -0,0 +1,3 @@ +# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl.html). + +from . import models diff --git a/dms_user_role/__manifest__.py b/dms_user_role/__manifest__.py new file mode 100644 index 000000000..c6f6a5104 --- /dev/null +++ b/dms_user_role/__manifest__.py @@ -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": "15.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"], +} diff --git a/dms_user_role/i18n/dms_user_role.pot b/dms_user_role/i18n/dms_user_role.pot new file mode 100644 index 000000000..be100b8f0 --- /dev/null +++ b/dms_user_role/i18n/dms_user_role.pot @@ -0,0 +1,30 @@ +# 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" +"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.fields,field_description:dms_user_role.field_dms_access_group__dms_directory_ids +msgid "DMS Directories" +msgstr "" + +#. 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 "" diff --git a/dms_user_role/i18n/es.po b/dms_user_role/i18n/es.po new file mode 100644 index 000000000..61c0363f0 --- /dev/null +++ b/dms_user_role/i18n/es.po @@ -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 15.0\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2024-03-05 10:23+0000\n" +"PO-Revision-Date: 2024-03-05 10:23+0000\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 "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 "" diff --git a/dms_user_role/models/__init__.py b/dms_user_role/models/__init__.py new file mode 100644 index 000000000..227172e52 --- /dev/null +++ b/dms_user_role/models/__init__.py @@ -0,0 +1,3 @@ +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). + +from . import dms_access_group diff --git a/dms_user_role/models/dms_access_group.py b/dms_user_role/models/dms_access_group.py new file mode 100644 index 000000000..9c0e2e757 --- /dev/null +++ b/dms_user_role/models/dms_access_group.py @@ -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 diff --git a/dms_user_role/readme/CONTRIBUTORS.rst b/dms_user_role/readme/CONTRIBUTORS.rst new file mode 100644 index 000000000..5fb713053 --- /dev/null +++ b/dms_user_role/readme/CONTRIBUTORS.rst @@ -0,0 +1,4 @@ +* `Tecnativa `_: + + * Víctor Martínez + * Pedro M. Baeza diff --git a/dms_user_role/readme/DESCRIPTION.rst b/dms_user_role/readme/DESCRIPTION.rst new file mode 100644 index 000000000..737c57ebf --- /dev/null +++ b/dms_user_role/readme/DESCRIPTION.rst @@ -0,0 +1 @@ +Use of roles (module base_user_role) in DMS access groups. diff --git a/dms_user_role/readme/USAGE.rst b/dms_user_role/readme/USAGE.rst new file mode 100644 index 000000000..8b2fb28dd --- /dev/null +++ b/dms_user_role/readme/USAGE.rst @@ -0,0 +1,5 @@ +#. Go to `Settins / Users & Companies / Roles` and create a new one. +#. Go to `Documents / Configuration / Access groups` and create or edit one. +#. Set in the "Roles" tab the one we have just created. +#. Go back to the role, edit it and add an extra user. +#. The extra user will have been added in the "Users" tab. diff --git a/dms_user_role/static/description/icon.png b/dms_user_role/static/description/icon.png new file mode 100644 index 0000000000000000000000000000000000000000..a561495f1c1bdbdf25724c6fa43e83e3507f5753 GIT binary patch literal 7197 zcmeHsXHb({xNhhmsI*OQQlxAMC<4-Jq)Cxp0>Y*#NRRZ6geoE}1f&?GOEF3dRZt*Q zBOpWwh@pfQ5JGP^``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K9tb;ON(2p$HTQ385ecw z=Z4MTuF5y6I6F-ML_c~_B4L44t*mjkMOYqwA}LSEyHT^Er{}@sWKw9l>r@v=a?||! z`>FTSi=QHyvtas!nruwubt({gqmn@%8R6s!I|_;ix{0KYZ5vPuw{7E}imr01-@7G?RMcaxTW6uV~DWk@_uf#6gtY z!a@mkCcr8*C727r1Nyh|f%e)U6Kng%8b?DSrPc^psx(=Fpds2So1%GMkgmOYK8_!b z#RoZi95KavSQ?h$sG&i}e<#d%1(_LzpjRKgL!QLB_O`zF{VHBMzor?t*Hkytb%wJ& zfQ`V|eH2IliNeaCdzB2Yaf(a|Ua+l9RJ&@Df9TQvG0xP5?sML{u042lS({y3v@vD* zk0O1UyFKA=c8=Jk)}AhixPGHD>Dyn4WD-u~^t6$vr?sVb9}7x$j81RLt9*=Xy{XjF z$WMlJQ~tyN?cwa4DJ+IMe_wDrV(+A*hxCQbOKhz(r_@#e@{KCb`{1HoLT5p4>NY|= zJvbYiL!)wn=48m~{lc6@)A|k!dsrgfol5wN1%VbM? z@W`stOM-!eTjlasI=%q3&0^0`_4Mg-z8!X|`QW&reR*7Y9P?2XfZa>IWv;1jYp-5X zKB5rZj + + + + + +DMS User Role + + + +
+

DMS User Role

+ + +

Beta License: AGPL-3 OCA/dms Translate me on Weblate Try me on Runboat

+

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

+

Table of contents

+ +
+

Usage

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

Bug Tracker

+

Bugs are tracked on GitHub 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.

+

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

+
+
+

Credits

+
+

Authors

+
    +
  • Tecnativa
  • +
+
+
+

Contributors

+
    +
  • Tecnativa:
      +
    • Víctor Martínez
    • +
    • Pedro M. Baeza
    • +
    +
  • +
+
+
+

Maintainers

+

This module is maintained by the OCA.

+Odoo Community Association +

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.

+

Current maintainer:

+

victoralmau

+

This module is part of the OCA/dms project on GitHub.

+

You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.

+
+
+
+ + diff --git a/dms_user_role/tests/__init__.py b/dms_user_role/tests/__init__.py new file mode 100644 index 000000000..f512007a5 --- /dev/null +++ b/dms_user_role/tests/__init__.py @@ -0,0 +1,3 @@ +# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl) + +from . import test_dms_user_role diff --git a/dms_user_role/tests/test_dms_user_role.py b/dms_user_role/tests/test_dms_user_role.py new file mode 100644 index 000000000..0d0c061ae --- /dev/null +++ b/dms_user_role/tests/test_dms_user_role.py @@ -0,0 +1,60 @@ +# Copyright 2024 Tecnativa - Víctor Martínez +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). + +from odoo.tests import common, new_test_user +from odoo.tools import mute_logger + + +class TestDmsUserRole(common.TransactionCase): + @classmethod + def setUpClass(cls): + super().setUpClass() + cls.env = cls.env( + context=dict( + cls.env.context, + mail_create_nolog=True, + mail_create_nosubscribe=True, + mail_notrack=True, + no_reset_password=True, + tracking_disable=True, + ) + ) + cls.user_a = new_test_user(cls.env, login="test_user_a") + cls.user_b = new_test_user(cls.env, login="test_user_b") + cls.user_c = new_test_user(cls.env, login="test_user_c") + cls.access_group = cls.env["dms.access.group"].create( + {"name": "Test group", "explicit_user_ids": [(4, cls.user_a.id)]} + ) + cls.user_role = cls.env["res.users.role"].create({"name": "Test user role"}) + + @mute_logger("odoo.models.unlink") + def test_user_role_change(self): + self.assertIn(self.user_a, self.access_group.users) + self.assertNotIn(self.user_b, self.access_group.users) + self.assertNotIn(self.user_c, self.access_group.users) + # Add User a to user_role: Without changes + self.user_role.line_ids = [(0, 0, {"user_id": self.user_a.id})] + self.assertIn(self.user_a, self.access_group.users) + self.assertNotIn(self.user_b, self.access_group.users) + self.assertNotIn(self.user_c, self.access_group.users) + # Set role to access group: Without changes + self.access_group.role_ids = [(4, self.user_role.id)] + self.assertIn(self.user_a, self.access_group.users) + self.assertNotIn(self.user_b, self.access_group.users) + self.assertNotIn(self.user_c, self.access_group.users) + # Add User b to user_role: User b is added to access groups + self.user_role.line_ids = [(0, 0, {"user_id": self.user_b.id})] + self.assertIn(self.user_a, self.access_group.users) + self.assertIn(self.user_b, self.access_group.users) + self.assertNotIn(self.user_c, self.access_group.users) + # Add User c to user_role: User c is added to access groups + self.user_role.line_ids = [(0, 0, {"user_id": self.user_c.id})] + self.assertIn(self.user_a, self.access_group.users) + self.assertIn(self.user_b, self.access_group.users) + self.assertIn(self.user_c, self.access_group.users) + # Remove User c from user role: User c is removed from access group + line_b = self.user_role.line_ids.filtered(lambda x: x.user_id == self.user_b) + self.user_role.line_ids = [(3, line_b.id)] + self.assertIn(self.user_a, self.access_group.users) + self.assertNotIn(self.user_b, self.access_group.users) + self.assertIn(self.user_c, self.access_group.users) diff --git a/dms_user_role/views/dms_access_group_views.xml b/dms_user_role/views/dms_access_group_views.xml new file mode 100644 index 000000000..66320e34b --- /dev/null +++ b/dms_user_role/views/dms_access_group_views.xml @@ -0,0 +1,21 @@ + + + + dms_access.group.form + dms.access.group + + + + + + + + + + + + + + + + From d6cbebe817b2caf367ad39f20b1d7d46bca569ce Mon Sep 17 00:00:00 2001 From: Ivorra78 Date: Wed, 27 Mar 2024 16:25:23 +0000 Subject: [PATCH 02/15] Translated using Weblate (Spanish) Currently translated at 100.0% (2 of 2 strings) Translation: dms-15.0/dms-15.0-dms_user_role Translate-URL: https://translation.odoo-community.org/projects/dms-15-0/dms-15-0-dms_user_role/es/ --- dms_user_role/i18n/es.po | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/dms_user_role/i18n/es.po b/dms_user_role/i18n/es.po index 61c0363f0..a56454d95 100644 --- a/dms_user_role/i18n/es.po +++ b/dms_user_role/i18n/es.po @@ -7,13 +7,15 @@ 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-03-05 10:23+0000\n" -"Last-Translator: \n" +"PO-Revision-Date: 2024-03-27 18:35+0000\n" +"Last-Translator: Ivorra78 \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: \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 @@ -24,4 +26,4 @@ msgstr "Grupos de acceso de registro" #: 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 "" +msgstr "Funciones" From 29ed7c9307d8f1618b7e56525f01b19ab167350c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=C3=ADctor=20Mart=C3=ADnez?= Date: Wed, 3 Apr 2024 08:19:59 +0200 Subject: [PATCH 03/15] [MIG] dms_user_role: Migration to 16.0 [UPD] Update dms_user_role.pot --- dms_user_role/README.rst | 14 +++++++------- dms_user_role/__manifest__.py | 2 +- dms_user_role/i18n/dms_user_role.pot | 7 +------ dms_user_role/readme/USAGE.rst | 2 +- dms_user_role/static/description/index.html | 10 +++++----- dms_user_role/tests/test_dms_user_role.py | 16 ++++------------ dms_user_role/views/dms_access_group_views.xml | 3 +-- 7 files changed, 20 insertions(+), 34 deletions(-) diff --git a/dms_user_role/README.rst b/dms_user_role/README.rst index 4a297d02f..937ce00a6 100644 --- a/dms_user_role/README.rst +++ b/dms_user_role/README.rst @@ -7,7 +7,7 @@ DMS User Role !! This file is generated by oca-gen-addon-readme !! !! changes will be overwritten. !! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! - !! source digest: sha256:b615f401d42710400a757a6835590ef3cc9f8a80f4e5704b36e7b12a260c4eb8 + !! source digest: sha256:548ac8b16e671ab1f31b09e82c3066f7661ab929f1da9b3d393ab17b4cbca473 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! .. |badge1| image:: https://img.shields.io/badge/maturity-Beta-yellow.png @@ -17,13 +17,13 @@ DMS User Role :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/15.0/dms_user_role + :target: https://github.com/OCA/dms/tree/16.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-15-0/dms-15-0-dms_user_role + :target: https://translation.odoo-community.org/projects/dms-16-0/dms-16-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=15.0 + :target: https://runboat.odoo-community.org/builds?repo=OCA/dms&target_branch=16.0 :alt: Try me on Runboat |badge1| |badge2| |badge3| |badge4| |badge5| @@ -38,7 +38,7 @@ Use of roles (module base_user_role) in DMS access groups. Usage ===== -#. Go to `Settins / Users & Companies / Roles` and create a new one. +#. Go to `Settings / Users & Companies / Roles` and create a new one. #. Go to `Documents / Configuration / Access groups` and create or edit one. #. Set in the "Roles" tab the one we have just created. #. Go back to the role, edit it and add an extra user. @@ -50,7 +50,7 @@ Bug Tracker Bugs are tracked on `GitHub 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 `_. +`feedback `_. Do not contact contributors directly about support or help with technical issues. @@ -91,6 +91,6 @@ Current `maintainer `__: |maintainer-victoralmau| -This module is part of the `OCA/dms `_ project on GitHub. +This module is part of the `OCA/dms `_ project on GitHub. You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute. diff --git a/dms_user_role/__manifest__.py b/dms_user_role/__manifest__.py index c6f6a5104..dc5dfc315 100644 --- a/dms_user_role/__manifest__.py +++ b/dms_user_role/__manifest__.py @@ -2,7 +2,7 @@ # License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl). { "name": "DMS User Role", - "version": "15.0.1.0.0", + "version": "16.0.1.0.0", "category": "Document Management", "website": "https://github.com/OCA/dms", "author": "Tecnativa, Odoo Community Association (OCA)", diff --git a/dms_user_role/i18n/dms_user_role.pot b/dms_user_role/i18n/dms_user_role.pot index be100b8f0..b034adef3 100644 --- a/dms_user_role/i18n/dms_user_role.pot +++ b/dms_user_role/i18n/dms_user_role.pot @@ -4,7 +4,7 @@ # msgid "" msgstr "" -"Project-Id-Version: Odoo Server 15.0\n" +"Project-Id-Version: Odoo Server 16.0\n" "Report-Msgid-Bugs-To: \n" "Last-Translator: \n" "Language-Team: \n" @@ -13,11 +13,6 @@ msgstr "" "Content-Transfer-Encoding: \n" "Plural-Forms: \n" -#. module: dms_user_role -#: model:ir.model.fields,field_description:dms_user_role.field_dms_access_group__dms_directory_ids -msgid "DMS Directories" -msgstr "" - #. module: dms_user_role #: model:ir.model,name:dms_user_role.model_dms_access_group msgid "Record Access Groups" diff --git a/dms_user_role/readme/USAGE.rst b/dms_user_role/readme/USAGE.rst index 8b2fb28dd..dd7acbb94 100644 --- a/dms_user_role/readme/USAGE.rst +++ b/dms_user_role/readme/USAGE.rst @@ -1,4 +1,4 @@ -#. Go to `Settins / Users & Companies / Roles` and create a new one. +#. Go to `Settings / Users & Companies / Roles` and create a new one. #. Go to `Documents / Configuration / Access groups` and create or edit one. #. Set in the "Roles" tab the one we have just created. #. Go back to the role, edit it and add an extra user. diff --git a/dms_user_role/static/description/index.html b/dms_user_role/static/description/index.html index ed1e48b9c..a13e1e591 100644 --- a/dms_user_role/static/description/index.html +++ b/dms_user_role/static/description/index.html @@ -367,9 +367,9 @@

DMS User Role

!! This file is generated by oca-gen-addon-readme !! !! changes will be overwritten. !! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -!! source digest: sha256:b615f401d42710400a757a6835590ef3cc9f8a80f4e5704b36e7b12a260c4eb8 +!! source digest: sha256:548ac8b16e671ab1f31b09e82c3066f7661ab929f1da9b3d393ab17b4cbca473 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! --> -

Beta License: AGPL-3 OCA/dms Translate me on Weblate Try me on Runboat

+

Beta License: AGPL-3 OCA/dms Translate me on Weblate Try me on Runboat

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

Table of contents

@@ -387,7 +387,7 @@

DMS User Role

Usage

    -
  1. Go to Settins / Users & Companies / Roles and create a new one.
  2. +
  3. Go to Settings / Users & Companies / Roles and create a new one.
  4. Go to Documents / Configuration / Access groups and create or edit one.
  5. Set in the “Roles” tab the one we have just created.
  6. Go back to the role, edit it and add an extra user.
  7. @@ -399,7 +399,7 @@

    Bug Tracker

    Bugs are tracked on GitHub 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.

    +feedback.

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

@@ -429,7 +429,7 @@

Maintainers

promote its widespread use.

Current maintainer:

victoralmau

-

This module is part of the OCA/dms project on GitHub.

+

This module is part of the OCA/dms project on GitHub.

You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.

diff --git a/dms_user_role/tests/test_dms_user_role.py b/dms_user_role/tests/test_dms_user_role.py index 0d0c061ae..8fce53709 100644 --- a/dms_user_role/tests/test_dms_user_role.py +++ b/dms_user_role/tests/test_dms_user_role.py @@ -1,24 +1,16 @@ # Copyright 2024 Tecnativa - Víctor Martínez # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). -from odoo.tests import common, new_test_user +from odoo.tests import new_test_user from odoo.tools import mute_logger +from odoo.addons.base.tests.common import BaseCommon -class TestDmsUserRole(common.TransactionCase): + +class TestDmsUserRole(BaseCommon): @classmethod def setUpClass(cls): super().setUpClass() - cls.env = cls.env( - context=dict( - cls.env.context, - mail_create_nolog=True, - mail_create_nosubscribe=True, - mail_notrack=True, - no_reset_password=True, - tracking_disable=True, - ) - ) cls.user_a = new_test_user(cls.env, login="test_user_a") cls.user_b = new_test_user(cls.env, login="test_user_b") cls.user_c = new_test_user(cls.env, login="test_user_c") diff --git a/dms_user_role/views/dms_access_group_views.xml b/dms_user_role/views/dms_access_group_views.xml index 66320e34b..3d5cd11a2 100644 --- a/dms_user_role/views/dms_access_group_views.xml +++ b/dms_user_role/views/dms_access_group_views.xml @@ -4,10 +4,9 @@ dms_access.group.form dms.access.group - - + From 7c62343f55be484969881f8a41e43ec0b0de9bb0 Mon Sep 17 00:00:00 2001 From: mymage Date: Thu, 4 Apr 2024 14:27:46 +0000 Subject: [PATCH 04/15] Added translation using Weblate (Italian) Translated using Weblate (Italian) Currently translated at 100.0% (2 of 2 strings) Translation: dms-16.0/dms-16.0-dms_user_role Translate-URL: https://translation.odoo-community.org/projects/dms-16-0/dms-16-0-dms_user_role/it/ --- dms_user_role/i18n/it.po | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 dms_user_role/i18n/it.po diff --git a/dms_user_role/i18n/it.po b/dms_user_role/i18n/it.po new file mode 100644 index 000000000..48e9074c4 --- /dev/null +++ b/dms_user_role/i18n/it.po @@ -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 \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" From 53d86d56d4d697ad55692e45261154d2a0c93e5f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=C3=ADctor=20Mart=C3=ADnez?= Date: Tue, 8 Oct 2024 14:57:08 +0000 Subject: [PATCH 05/15] Translated using Weblate (Spanish) Currently translated at 100.0% (2 of 2 strings) Translation: dms-16.0/dms-16.0-dms_user_role Translate-URL: https://translation.odoo-community.org/projects/dms-16-0/dms-16-0-dms_user_role/es/ --- dms_user_role/i18n/es.po | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/dms_user_role/i18n/es.po b/dms_user_role/i18n/es.po index a56454d95..feb609f5f 100644 --- a/dms_user_role/i18n/es.po +++ b/dms_user_role/i18n/es.po @@ -7,15 +7,15 @@ 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-03-27 18:35+0000\n" -"Last-Translator: Ivorra78 \n" +"PO-Revision-Date: 2024-10-08 17:06+0000\n" +"Last-Translator: Víctor Martínez \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 4.17\n" +"X-Generator: Weblate 5.6.2\n" #. module: dms_user_role #: model:ir.model,name:dms_user_role.model_dms_access_group @@ -26,4 +26,4 @@ msgstr "Grupos de acceso de registro" #: 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 "Funciones" +msgstr "Roles" From 3d2ab903931eec46254ba3d7844ba62729796626 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=C3=ADctor=20Mart=C3=ADnez?= Date: Wed, 16 Apr 2025 09:28:27 +0200 Subject: [PATCH 06/15] [IMP] dms_user_role: pre-commit auto fixes --- dms_user_role/README.rst | 33 ++++++++++--------- dms_user_role/pyproject.toml | 3 ++ dms_user_role/readme/CONTRIBUTORS.md | 3 ++ dms_user_role/readme/CONTRIBUTORS.rst | 4 --- .../{DESCRIPTION.rst => DESCRIPTION.md} | 0 dms_user_role/readme/USAGE.md | 6 ++++ dms_user_role/readme/USAGE.rst | 5 --- dms_user_role/static/description/index.html | 23 +++++++------ 8 files changed, 42 insertions(+), 35 deletions(-) create mode 100644 dms_user_role/pyproject.toml create mode 100644 dms_user_role/readme/CONTRIBUTORS.md delete mode 100644 dms_user_role/readme/CONTRIBUTORS.rst rename dms_user_role/readme/{DESCRIPTION.rst => DESCRIPTION.md} (100%) create mode 100644 dms_user_role/readme/USAGE.md delete mode 100644 dms_user_role/readme/USAGE.rst diff --git a/dms_user_role/README.rst b/dms_user_role/README.rst index 937ce00a6..ff9b2d4b1 100644 --- a/dms_user_role/README.rst +++ b/dms_user_role/README.rst @@ -17,13 +17,13 @@ DMS User Role :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/16.0/dms_user_role + :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-16-0/dms-16-0-dms_user_role + :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=16.0 + :target: https://runboat.odoo-community.org/builds?repo=OCA/dms&target_branch=18.0 :alt: Try me on Runboat |badge1| |badge2| |badge3| |badge4| |badge5| @@ -38,11 +38,12 @@ Use of roles (module base_user_role) in DMS access groups. Usage ===== -#. Go to `Settings / Users & Companies / Roles` and create a new one. -#. Go to `Documents / Configuration / Access groups` and create or edit one. -#. Set in the "Roles" tab the one we have just created. -#. Go back to the role, edit it and add an extra user. -#. The extra user will have been added in the "Users" tab. +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 =========== @@ -50,7 +51,7 @@ Bug Tracker Bugs are tracked on `GitHub 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 `_. +`feedback `_. Do not contact contributors directly about support or help with technical issues. @@ -58,20 +59,20 @@ Credits ======= Authors -~~~~~~~ +------- * Tecnativa Contributors -~~~~~~~~~~~~ +------------ -* `Tecnativa `_: +- `Tecnativa `__: - * Víctor Martínez - * Pedro M. Baeza + - Víctor Martínez + - Pedro M. Baeza Maintainers -~~~~~~~~~~~ +----------- This module is maintained by the OCA. @@ -91,6 +92,6 @@ Current `maintainer `__: |maintainer-victoralmau| -This module is part of the `OCA/dms `_ project on GitHub. +This module is part of the `OCA/dms `_ project on GitHub. You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute. diff --git a/dms_user_role/pyproject.toml b/dms_user_role/pyproject.toml new file mode 100644 index 000000000..4231d0ccc --- /dev/null +++ b/dms_user_role/pyproject.toml @@ -0,0 +1,3 @@ +[build-system] +requires = ["whool"] +build-backend = "whool.buildapi" diff --git a/dms_user_role/readme/CONTRIBUTORS.md b/dms_user_role/readme/CONTRIBUTORS.md new file mode 100644 index 000000000..5fee39042 --- /dev/null +++ b/dms_user_role/readme/CONTRIBUTORS.md @@ -0,0 +1,3 @@ +- [Tecnativa](https://www.tecnativa.com): + - Víctor Martínez + - Pedro M. Baeza diff --git a/dms_user_role/readme/CONTRIBUTORS.rst b/dms_user_role/readme/CONTRIBUTORS.rst deleted file mode 100644 index 5fb713053..000000000 --- a/dms_user_role/readme/CONTRIBUTORS.rst +++ /dev/null @@ -1,4 +0,0 @@ -* `Tecnativa `_: - - * Víctor Martínez - * Pedro M. Baeza diff --git a/dms_user_role/readme/DESCRIPTION.rst b/dms_user_role/readme/DESCRIPTION.md similarity index 100% rename from dms_user_role/readme/DESCRIPTION.rst rename to dms_user_role/readme/DESCRIPTION.md diff --git a/dms_user_role/readme/USAGE.md b/dms_user_role/readme/USAGE.md new file mode 100644 index 000000000..b818e0024 --- /dev/null +++ b/dms_user_role/readme/USAGE.md @@ -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. diff --git a/dms_user_role/readme/USAGE.rst b/dms_user_role/readme/USAGE.rst deleted file mode 100644 index dd7acbb94..000000000 --- a/dms_user_role/readme/USAGE.rst +++ /dev/null @@ -1,5 +0,0 @@ -#. Go to `Settings / Users & Companies / Roles` and create a new one. -#. Go to `Documents / Configuration / Access groups` and create or edit one. -#. Set in the "Roles" tab the one we have just created. -#. Go back to the role, edit it and add an extra user. -#. The extra user will have been added in the "Users" tab. diff --git a/dms_user_role/static/description/index.html b/dms_user_role/static/description/index.html index a13e1e591..990bf2c63 100644 --- a/dms_user_role/static/description/index.html +++ b/dms_user_role/static/description/index.html @@ -1,4 +1,3 @@ - @@ -9,10 +8,11 @@ /* :Author: David Goodger (goodger@python.org) -:Id: $Id: html4css1.css 8954 2022-01-20 10:10:25Z milde $ +:Id: $Id: html4css1.css 9511 2024-01-13 09:50:07Z milde $ :Copyright: This stylesheet has been placed in the public domain. Default cascading style sheet for the HTML output of Docutils. +Despite the name, some widely supported CSS2 features are used. See https://docutils.sourceforge.io/docs/howto/html-stylesheets.html for how to customize this style sheet. @@ -275,7 +275,7 @@ margin-left: 2em ; margin-right: 2em } -pre.code .ln { color: grey; } /* line numbers */ +pre.code .ln { color: gray; } /* line numbers */ pre.code, code { background-color: #eeeeee } pre.code .comment, code .comment { color: #5C6576 } pre.code .keyword, code .keyword { color: #3B0D06; font-weight: bold } @@ -301,7 +301,7 @@ span.pre { white-space: pre } -span.problematic { +span.problematic, pre.problematic { color: red } span.section-subtitle { @@ -369,7 +369,7 @@

DMS User Role

!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! !! source digest: sha256:548ac8b16e671ab1f31b09e82c3066f7661ab929f1da9b3d393ab17b4cbca473 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! --> -

Beta License: AGPL-3 OCA/dms Translate me on Weblate Try me on Runboat

+

Beta License: AGPL-3 OCA/dms Translate me on Weblate Try me on Runboat

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

Table of contents

@@ -387,8 +387,9 @@

DMS User Role

Usage

    -
  1. Go to Settings / Users & Companies / Roles and create a new one.
  2. -
  3. Go to Documents / Configuration / Access groups and create or edit one.
  4. +
  5. Go to Settings / Users & Companies / Roles and create a new one.
  6. +
  7. Go to Documents / Configuration / Access groups and create or edit +one.
  8. Set in the “Roles” tab the one we have just created.
  9. Go back to the role, edit it and add an extra user.
  10. The extra user will have been added in the “Users” tab.
  11. @@ -399,7 +400,7 @@

    Bug Tracker

    Bugs are tracked on GitHub 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.

    +feedback.

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

@@ -423,13 +424,15 @@

Contributors

Maintainers

This module is maintained by the OCA.

-Odoo Community Association + +Odoo Community Association +

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.

Current maintainer:

victoralmau

-

This module is part of the OCA/dms project on GitHub.

+

This module is part of the OCA/dms project on GitHub.

You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.

From 34a493bfeed24d03f515e893949c4e3db6a43693 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=C3=ADctor=20Mart=C3=ADnez?= Date: Wed, 16 Apr 2025 09:29:48 +0200 Subject: [PATCH 07/15] [MIG] dms_user_role: Migration to 18.0 TT55509 --- dms_user_role/__manifest__.py | 2 +- dms_user_role/tests/test_dms_user_role.py | 16 ++++++++-------- dms_user_role/views/dms_access_group_views.xml | 4 ++-- 3 files changed, 11 insertions(+), 11 deletions(-) diff --git a/dms_user_role/__manifest__.py b/dms_user_role/__manifest__.py index dc5dfc315..73b8102d5 100644 --- a/dms_user_role/__manifest__.py +++ b/dms_user_role/__manifest__.py @@ -2,7 +2,7 @@ # License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl). { "name": "DMS User Role", - "version": "16.0.1.0.0", + "version": "18.0.1.0.0", "category": "Document Management", "website": "https://github.com/OCA/dms", "author": "Tecnativa, Odoo Community Association (OCA)", diff --git a/dms_user_role/tests/test_dms_user_role.py b/dms_user_role/tests/test_dms_user_role.py index 8fce53709..cd7222b3a 100644 --- a/dms_user_role/tests/test_dms_user_role.py +++ b/dms_user_role/tests/test_dms_user_role.py @@ -1,6 +1,6 @@ -# Copyright 2024 Tecnativa - Víctor Martínez +# Copyright 2024-2025 Tecnativa - Víctor Martínez # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). - +from odoo import Command from odoo.tests import new_test_user from odoo.tools import mute_logger @@ -15,7 +15,7 @@ def setUpClass(cls): cls.user_b = new_test_user(cls.env, login="test_user_b") cls.user_c = new_test_user(cls.env, login="test_user_c") cls.access_group = cls.env["dms.access.group"].create( - {"name": "Test group", "explicit_user_ids": [(4, cls.user_a.id)]} + {"name": "Test group", "explicit_user_ids": [Command.link(cls.user_a.id)]} ) cls.user_role = cls.env["res.users.role"].create({"name": "Test user role"}) @@ -25,28 +25,28 @@ def test_user_role_change(self): self.assertNotIn(self.user_b, self.access_group.users) self.assertNotIn(self.user_c, self.access_group.users) # Add User a to user_role: Without changes - self.user_role.line_ids = [(0, 0, {"user_id": self.user_a.id})] + self.user_role.line_ids = [Command.create({"user_id": self.user_a.id})] self.assertIn(self.user_a, self.access_group.users) self.assertNotIn(self.user_b, self.access_group.users) self.assertNotIn(self.user_c, self.access_group.users) # Set role to access group: Without changes - self.access_group.role_ids = [(4, self.user_role.id)] + self.access_group.role_ids = [Command.link(self.user_role.id)] self.assertIn(self.user_a, self.access_group.users) self.assertNotIn(self.user_b, self.access_group.users) self.assertNotIn(self.user_c, self.access_group.users) # Add User b to user_role: User b is added to access groups - self.user_role.line_ids = [(0, 0, {"user_id": self.user_b.id})] + self.user_role.line_ids = [Command.create({"user_id": self.user_b.id})] self.assertIn(self.user_a, self.access_group.users) self.assertIn(self.user_b, self.access_group.users) self.assertNotIn(self.user_c, self.access_group.users) # Add User c to user_role: User c is added to access groups - self.user_role.line_ids = [(0, 0, {"user_id": self.user_c.id})] + self.user_role.line_ids = [Command.create({"user_id": self.user_c.id})] self.assertIn(self.user_a, self.access_group.users) self.assertIn(self.user_b, self.access_group.users) self.assertIn(self.user_c, self.access_group.users) # Remove User c from user role: User c is removed from access group line_b = self.user_role.line_ids.filtered(lambda x: x.user_id == self.user_b) - self.user_role.line_ids = [(3, line_b.id)] + self.user_role.line_ids = [Command.delete(line_b.id)] self.assertIn(self.user_a, self.access_group.users) self.assertNotIn(self.user_b, self.access_group.users) self.assertIn(self.user_c, self.access_group.users) diff --git a/dms_user_role/views/dms_access_group_views.xml b/dms_user_role/views/dms_access_group_views.xml index 3d5cd11a2..10c233207 100644 --- a/dms_user_role/views/dms_access_group_views.xml +++ b/dms_user_role/views/dms_access_group_views.xml @@ -8,10 +8,10 @@ - + - + From 2867edaf3e87abd373b63658d9903f914e9d3c9e Mon Sep 17 00:00:00 2001 From: oca-ci Date: Wed, 16 Apr 2025 17:53:11 +0000 Subject: [PATCH 08/15] [UPD] Update dms_user_role.pot --- dms_user_role/i18n/dms_user_role.pot | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dms_user_role/i18n/dms_user_role.pot b/dms_user_role/i18n/dms_user_role.pot index b034adef3..1ea0df0f4 100644 --- a/dms_user_role/i18n/dms_user_role.pot +++ b/dms_user_role/i18n/dms_user_role.pot @@ -4,7 +4,7 @@ # msgid "" msgstr "" -"Project-Id-Version: Odoo Server 16.0\n" +"Project-Id-Version: Odoo Server 18.0\n" "Report-Msgid-Bugs-To: \n" "Last-Translator: \n" "Language-Team: \n" From f1f38b24a947f99d188b5332ab00e072259806d8 Mon Sep 17 00:00:00 2001 From: OCA-git-bot Date: Wed, 16 Apr 2025 17:55:37 +0000 Subject: [PATCH 09/15] [BOT] post-merge updates --- dms_user_role/README.rst | 8 ++++---- dms_user_role/static/description/index.html | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/dms_user_role/README.rst b/dms_user_role/README.rst index ff9b2d4b1..86edfa162 100644 --- a/dms_user_role/README.rst +++ b/dms_user_role/README.rst @@ -7,7 +7,7 @@ DMS User Role !! This file is generated by oca-gen-addon-readme !! !! changes will be overwritten. !! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! - !! source digest: sha256:548ac8b16e671ab1f31b09e82c3066f7661ab929f1da9b3d393ab17b4cbca473 + !! source digest: sha256:35aa1f1c4b7cc8c6de3e9f920b4c825356bfae6c0c9a675a5ab84cdaaec039eb !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! .. |badge1| image:: https://img.shields.io/badge/maturity-Beta-yellow.png @@ -66,10 +66,10 @@ Authors Contributors ------------ -- `Tecnativa `__: +- `Tecnativa `__: - - Víctor Martínez - - Pedro M. Baeza + - Víctor Martínez + - Pedro M. Baeza Maintainers ----------- diff --git a/dms_user_role/static/description/index.html b/dms_user_role/static/description/index.html index 990bf2c63..90b5422ec 100644 --- a/dms_user_role/static/description/index.html +++ b/dms_user_role/static/description/index.html @@ -367,7 +367,7 @@

DMS User Role

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

Beta License: AGPL-3 OCA/dms Translate me on Weblate Try me on Runboat

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

From dafa15ca577e768131bbfae99af899ddc2c3ca27 Mon Sep 17 00:00:00 2001 From: jakobkrabbe Date: Fri, 19 Sep 2025 12:53:25 +0000 Subject: [PATCH 10/15] Added translation using Weblate (Swedish) --- dms_user_role/i18n/sv.po | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100644 dms_user_role/i18n/sv.po diff --git a/dms_user_role/i18n/sv.po b/dms_user_role/i18n/sv.po new file mode 100644 index 000000000..2120876c1 --- /dev/null +++ b/dms_user_role/i18n/sv.po @@ -0,0 +1,26 @@ +# 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: 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" + +#. 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 "" From 3ed8e11817d6f8f7c2d4f3e6dc4f135c15616174 Mon Sep 17 00:00:00 2001 From: jakobkrabbe Date: Fri, 19 Sep 2025 12:53:53 +0000 Subject: [PATCH 11/15] Translated using Weblate (Swedish) Currently translated at 100.0% (2 of 2 strings) Translation: dms-18.0/dms-18.0-dms_user_role Translate-URL: https://translation.odoo-community.org/projects/dms-18-0/dms-18-0-dms_user_role/sv/ --- dms_user_role/i18n/sv.po | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/dms_user_role/i18n/sv.po b/dms_user_role/i18n/sv.po index 2120876c1..9ed50432d 100644 --- a/dms_user_role/i18n/sv.po +++ b/dms_user_role/i18n/sv.po @@ -6,21 +6,23 @@ msgid "" msgstr "" "Project-Id-Version: Odoo Server 18.0\n" "Report-Msgid-Bugs-To: \n" -"Last-Translator: Automatically generated\n" +"PO-Revision-Date: 2025-09-19 13:31+0000\n" +"Last-Translator: jakobkrabbe \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 "" +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 "" +msgstr "Roller" From 3d50a5b9e18e20786fe1294ab08059e6974f2d8d Mon Sep 17 00:00:00 2001 From: Mohamed Essam Salem Date: Thu, 14 May 2026 22:41:36 +0000 Subject: [PATCH 12/15] Added translation using Weblate (Arabic) --- dms_user_role/i18n/ar.po | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100644 dms_user_role/i18n/ar.po diff --git a/dms_user_role/i18n/ar.po b/dms_user_role/i18n/ar.po new file mode 100644 index 000000000..53b06195e --- /dev/null +++ b/dms_user_role/i18n/ar.po @@ -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 "" From c02047dc24c0cd001ca9f0f537a18a8fc24f2537 Mon Sep 17 00:00:00 2001 From: Matjaz Mozetic Date: Tue, 9 Jun 2026 09:07:03 +0000 Subject: [PATCH 13/15] Added translation using Weblate (Slovenian) --- dms_user_role/i18n/sl.po | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100644 dms_user_role/i18n/sl.po diff --git a/dms_user_role/i18n/sl.po b/dms_user_role/i18n/sl.po new file mode 100644 index 000000000..af16db1e2 --- /dev/null +++ b/dms_user_role/i18n/sl.po @@ -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: 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" + +#. 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 "" From 9c1e24232fa21598e90033c05de4fca4d12bebdb Mon Sep 17 00:00:00 2001 From: Matjaz Mozetic Date: Tue, 9 Jun 2026 09:07:20 +0000 Subject: [PATCH 14/15] Translated using Weblate (Slovenian) Currently translated at 100.0% (2 of 2 strings) Translation: dms-18.0/dms-18.0-dms_user_role Translate-URL: https://translation.odoo-community.org/projects/dms-18-0/dms-18-0-dms_user_role/sl/ --- dms_user_role/i18n/sl.po | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/dms_user_role/i18n/sl.po b/dms_user_role/i18n/sl.po index af16db1e2..361e739f3 100644 --- a/dms_user_role/i18n/sl.po +++ b/dms_user_role/i18n/sl.po @@ -6,7 +6,8 @@ msgid "" msgstr "" "Project-Id-Version: Odoo Server 18.0\n" "Report-Msgid-Bugs-To: \n" -"Last-Translator: Automatically generated\n" +"PO-Revision-Date: 2026-06-09 11:46+0000\n" +"Last-Translator: Matjaz Mozetic \n" "Language-Team: none\n" "Language: sl\n" "MIME-Version: 1.0\n" @@ -14,14 +15,15 @@ msgstr "" "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 "" +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 "" +msgstr "Vloge" From 99cd4a4cf5f54af20bdc6c9399b6ded4392f3ce0 Mon Sep 17 00:00:00 2001 From: mmircoli-nexapp Date: Mon, 22 Jun 2026 16:51:36 +0200 Subject: [PATCH 15/15] [MIG] dms_user_role: Migration to 19.0 --- dms_user_role/__manifest__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dms_user_role/__manifest__.py b/dms_user_role/__manifest__.py index 73b8102d5..b20d55ad3 100644 --- a/dms_user_role/__manifest__.py +++ b/dms_user_role/__manifest__.py @@ -2,7 +2,7 @@ # License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl). { "name": "DMS User Role", - "version": "18.0.1.0.0", + "version": "19.0.1.0.0", "category": "Document Management", "website": "https://github.com/OCA/dms", "author": "Tecnativa, Odoo Community Association (OCA)",