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
104 changes: 104 additions & 0 deletions document_page_access_group_user_role/README.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,104 @@
.. image:: https://odoo-community.org/readme-banner-image
:target: https://odoo-community.org/get-involved?utm_source=readme
:alt: Odoo Community Association

====================================
Document Page Access Group User Role
====================================

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

.. |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/license-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%2Fknowledge-lightgray.png?logo=github
:target: https://github.com/OCA/knowledge/tree/19.0/document_page_access_group_user_role
:alt: OCA/knowledge
.. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png
:target: https://translation.odoo-community.org/projects/knowledge-19-0/knowledge-19-0-document_page_access_group_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/knowledge&target_branch=19.0
:alt: Try me on Runboat

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

Use of roles (module base_user_role) in Document Pages.

**Table of contents**

.. contents::
:local:

Usage
=====

1. Go to Settings / Users & Companies / Roles and create a new one.
2. Go to Knowledge / Pages 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 any group(s).
5. The role users will have been added in the "Security" tab.

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

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

* Tecnativa

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

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

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

- `Heliconia Solutions Pvt. Ltd. <https://www.heliconia.io>`__

- Bhavesh Heliconia

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/knowledge <https://github.com/OCA/knowledge/tree/19.0/document_page_access_group_user_role>`_ project on GitHub.

You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.
1 change: 1 addition & 0 deletions document_page_access_group_user_role/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
from . import models
16 changes: 16 additions & 0 deletions document_page_access_group_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": "Document Page Access Group User Role",
"author": "Tecnativa, Odoo Community Association (OCA)",
"website": "https://github.com/OCA/knowledge",
"version": "19.0.1.0.0",
"depends": ["document_page_access_group", "base_user_role"],
"license": "AGPL-3",
"category": "Knowledge",
"data": [
"views/document_page_views.xml",
],
"installable": True,
"maintainers": ["victoralmau"],
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * document_page_access_group_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: document_page_access_group_user_role
#: model:ir.model,name:document_page_access_group_user_role.model_document_page
msgid "Document Page"
msgstr ""

#. module: document_page_access_group_user_role
#: model:ir.model.fields,field_description:document_page_access_group_user_role.field_document_page__role_ids
#: model_terms:ir.ui.view,arch_db:document_page_access_group_user_role.document_page_access_group_view_wiki_form
msgid "Roles"
msgstr ""

#. module: document_page_access_group_user_role
#: model:ir.model.fields,field_description:document_page_access_group_user_role.field_document_page__user_ids
msgid "Users"
msgstr ""
34 changes: 34 additions & 0 deletions document_page_access_group_user_role/i18n/es.po
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * document_page_access_group_user_role
#
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 16.0\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2024-05-31 10:50+0000\n"
"PO-Revision-Date: 2024-05-31 12:51+0200\n"
"Last-Translator: \n"
"Language-Team: \n"
"Language: es\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: \n"
"X-Generator: Poedit 3.0.1\n"

#. module: document_page_access_group_user_role
#: model:ir.model,name:document_page_access_group_user_role.model_document_page
msgid "Document Page"
msgstr "Página del documento"

#. module: document_page_access_group_user_role
#: model:ir.model.fields,field_description:document_page_access_group_user_role.field_document_page__role_ids
#: model_terms:ir.ui.view,arch_db:document_page_access_group_user_role.document_page_access_group_view_wiki_form
msgid "Roles"
msgstr "Roles"

#. module: document_page_access_group_user_role
#: model:ir.model.fields,field_description:document_page_access_group_user_role.field_document_page__user_ids
msgid "Users"
msgstr ""
36 changes: 36 additions & 0 deletions document_page_access_group_user_role/i18n/it.po
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * document_page_access_group_user_role
#
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 16.0\n"
"Report-Msgid-Bugs-To: \n"
"PO-Revision-Date: 2024-08-12 08:58+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 5.6.2\n"

#. module: document_page_access_group_user_role
#: model:ir.model,name:document_page_access_group_user_role.model_document_page
msgid "Document Page"
msgstr "Pagina documento"

#. module: document_page_access_group_user_role
#: model:ir.model.fields,field_description:document_page_access_group_user_role.field_document_page__role_ids
#: model_terms:ir.ui.view,arch_db:document_page_access_group_user_role.document_page_access_group_view_wiki_form
msgid "Roles"
msgstr "Ruoli"

#. module: document_page_access_group_user_role
#: model:ir.model.fields,field_description:document_page_access_group_user_role.field_document_page__user_ids
msgid "Users"
msgstr "Utenti"

#~ msgid "Groups"
#~ msgstr "Gruppi"
36 changes: 36 additions & 0 deletions document_page_access_group_user_role/i18n/pt.po
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * document_page_access_group_user_role
#
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 16.0\n"
"Report-Msgid-Bugs-To: \n"
"PO-Revision-Date: 2025-02-04 17:11+0000\n"
"Last-Translator: Peter Romão <peterromao@yahoo.co.uk>\n"
"Language-Team: none\n"
"Language: pt\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: document_page_access_group_user_role
#: model:ir.model,name:document_page_access_group_user_role.model_document_page
msgid "Document Page"
msgstr "Página do Documento"

#. module: document_page_access_group_user_role
#: model:ir.model.fields,field_description:document_page_access_group_user_role.field_document_page__role_ids
#: model_terms:ir.ui.view,arch_db:document_page_access_group_user_role.document_page_access_group_view_wiki_form
msgid "Roles"
msgstr "Papéis"

#. module: document_page_access_group_user_role
#: model:ir.model.fields,field_description:document_page_access_group_user_role.field_document_page__user_ids
msgid "Users"
msgstr "Utilizadores"

#~ msgid "Groups"
#~ msgstr "Grupos"
3 changes: 3 additions & 0 deletions document_page_access_group_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 document_page
23 changes: 23 additions & 0 deletions document_page_access_group_user_role/models/document_page.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# 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 DocumentPage(models.Model):
_inherit = "document.page"

user_ids = fields.Many2many(compute="_compute_user_ids", store=True, readonly=False)
role_ids = fields.Many2many(
comodel_name="res.users.role",
relation="document_page_user_roles_rel",
column1="page_id",
column2="role_id",
string="Roles",
)

@api.depends("role_ids", "role_ids.user_ids")
def _compute_user_ids(self):
"""compute to auto-set all the users of the related roles."""
for item in self:
item.user_ids += item.mapped("role_ids.user_ids")
3 changes: 3 additions & 0 deletions document_page_access_group_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"
5 changes: 5 additions & 0 deletions document_page_access_group_user_role/readme/CONTRIBUTORS.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
- [Tecnativa](https://www.tecnativa.com):
- Víctor Martínez
- Pedro M. Baeza
- [Heliconia Solutions Pvt. Ltd.](https://www.heliconia.io)
- Bhavesh Heliconia
1 change: 1 addition & 0 deletions document_page_access_group_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 Document Pages.
5 changes: 5 additions & 0 deletions document_page_access_group_user_role/readme/USAGE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
1. Go to Settings / Users & Companies / Roles and create a new one.
2. Go to Knowledge / Pages 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 any group(s).
5. The role users will have been added in the "Security" tab.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Loading