-
-
Notifications
You must be signed in to change notification settings - Fork 334
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by StefanRijnhart
- Loading branch information
Showing
20 changed files
with
856 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,79 @@ | ||
=================== | ||
Document Page Group | ||
=================== | ||
|
||
.. | ||
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! | ||
!! This file is generated by oca-gen-addon-readme !! | ||
!! changes will be overwritten. !! | ||
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! | ||
!! source digest: sha256:66053447d3b9de33ad8ea86a718107d908a3d2e2945b788b7f782350e5da299b | ||
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! | ||
.. |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%2Fknowledge-lightgray.png?logo=github | ||
:target: https://github.com/OCA/knowledge/tree/17.0/document_page_group | ||
:alt: OCA/knowledge | ||
.. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png | ||
:target: https://translation.odoo-community.org/projects/knowledge-17-0/knowledge-17-0-document_page_group | ||
: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=17.0 | ||
:alt: Try me on Runboat | ||
|
||
|badge1| |badge2| |badge3| |badge4| |badge5| | ||
|
||
This module allows to define groups on a category. | ||
|
||
**Table of contents** | ||
|
||
.. contents:: | ||
:local: | ||
|
||
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_group%0Aversion:%2017.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 | ||
------- | ||
|
||
* Creu Blanca | ||
|
||
Contributors | ||
------------ | ||
|
||
- Enric Tobella <[email protected]> | ||
- [APSL-Nagarro](https://apsl.tech): | ||
|
||
- Antoni Marroig <[email protected]> | ||
|
||
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. | ||
|
||
This module is part of the `OCA/knowledge <https://github.com/OCA/knowledge/tree/17.0/document_page_group>`_ project on GitHub. | ||
|
||
You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
from . import models |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
# Copyright 2019 Creu Blanca | ||
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). | ||
|
||
{ | ||
"name": "Document Page Group", | ||
"summary": """ | ||
Define access groups on documents""", | ||
"version": "17.0.1.0.0", | ||
"license": "AGPL-3", | ||
"author": "Creu Blanca,Odoo Community Association (OCA)", | ||
"website": "https://github.com/OCA/knowledge", | ||
"depends": ["document_page"], | ||
"data": ["security/document_page_security.xml", "views/document_page.xml"], | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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_group | ||
# | ||
msgid "" | ||
msgstr "" | ||
"Project-Id-Version: Odoo Server 16.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_group | ||
#: model:ir.model,name:document_page_group.model_document_page | ||
msgid "Document Page" | ||
msgstr "" | ||
|
||
#. module: document_page_group | ||
#: model:ir.model.fields,field_description:document_page_group.field_document_page__group_ids | ||
msgid "Group" | ||
msgstr "" | ||
|
||
#. module: document_page_group | ||
#: model:ir.model.fields,help:document_page_group.field_document_page__direct_group_ids | ||
msgid "Set the groups that can view this category and its childs" | ||
msgstr "" | ||
|
||
#. module: document_page_group | ||
#: model:ir.model.fields,field_description:document_page_group.field_document_page__direct_group_ids | ||
msgid "Visible to" | ||
msgstr "" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
# Translation of Odoo Server. | ||
# This file contains the translation of the following modules: | ||
# * document_page_group | ||
# | ||
msgid "" | ||
msgstr "" | ||
"Project-Id-Version: Odoo Server 11.0\n" | ||
"Report-Msgid-Bugs-To: \n" | ||
"PO-Revision-Date: 2020-01-15 16:23+0000\n" | ||
"Last-Translator: Enric Tobella <[email protected]>\n" | ||
"Language-Team: none\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 3.10\n" | ||
|
||
#. module: document_page_group | ||
#: model:ir.model,name:document_page_group.model_document_page | ||
msgid "Document Page" | ||
msgstr "Página del documento" | ||
|
||
#. module: document_page_group | ||
#: model:ir.model.fields,field_description:document_page_group.field_document_page__group_ids | ||
msgid "Group" | ||
msgstr "Grupo" | ||
|
||
#. module: document_page_group | ||
#: model:ir.model.fields,help:document_page_group.field_document_page__direct_group_ids | ||
msgid "Set the groups that can view this category and its childs" | ||
msgstr "Definir los grupos que puede ver una categoría y sus hijos" | ||
|
||
#. module: document_page_group | ||
#: model:ir.model.fields,field_description:document_page_group.field_document_page__direct_group_ids | ||
msgid "Visible to" | ||
msgstr "Visible para" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
# Translation of Odoo Server. | ||
# This file contains the translation of the following modules: | ||
# * document_page_group | ||
# | ||
msgid "" | ||
msgstr "" | ||
"Project-Id-Version: Odoo Server 16.0\n" | ||
"Report-Msgid-Bugs-To: \n" | ||
"PO-Revision-Date: 2023-02-13 13:23+0000\n" | ||
"Last-Translator: Bole <[email protected]>\n" | ||
"Language-Team: none\n" | ||
"Language: hr\n" | ||
"MIME-Version: 1.0\n" | ||
"Content-Type: text/plain; charset=UTF-8\n" | ||
"Content-Transfer-Encoding: \n" | ||
"Plural-Forms: nplurals=3; plural=n%10==1 && n%100!=11 ? 0 : n%10>=2 && n" | ||
"%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2;\n" | ||
"X-Generator: Weblate 4.14.1\n" | ||
|
||
#. module: document_page_group | ||
#: model:ir.model,name:document_page_group.model_document_page | ||
msgid "Document Page" | ||
msgstr "Stranica dokumenta" | ||
|
||
#. module: document_page_group | ||
#: model:ir.model.fields,field_description:document_page_group.field_document_page__group_ids | ||
msgid "Group" | ||
msgstr "Grupa" | ||
|
||
#. module: document_page_group | ||
#: model:ir.model.fields,help:document_page_group.field_document_page__direct_group_ids | ||
msgid "Set the groups that can view this category and its childs" | ||
msgstr "Postavite grupe koje mogu vidjeti ovu kategoriju i njoj podređene" | ||
|
||
#. module: document_page_group | ||
#: model:ir.model.fields,field_description:document_page_group.field_document_page__direct_group_ids | ||
msgid "Visible to" | ||
msgstr "Vidljivo za" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
# Translation of Odoo Server. | ||
# This file contains the translation of the following modules: | ||
# * document_page_group | ||
# | ||
msgid "" | ||
msgstr "" | ||
"Project-Id-Version: Odoo Server 16.0\n" | ||
"Report-Msgid-Bugs-To: \n" | ||
"PO-Revision-Date: 2023-06-23 09:09+0000\n" | ||
"Last-Translator: mymage <[email protected]>\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: document_page_group | ||
#: model:ir.model,name:document_page_group.model_document_page | ||
msgid "Document Page" | ||
msgstr "Pagina documento" | ||
|
||
#. module: document_page_group | ||
#: model:ir.model.fields,field_description:document_page_group.field_document_page__group_ids | ||
msgid "Group" | ||
msgstr "Gruppo" | ||
|
||
#. module: document_page_group | ||
#: model:ir.model.fields,help:document_page_group.field_document_page__direct_group_ids | ||
msgid "Set the groups that can view this category and its childs" | ||
msgstr "Imposta i gruppi che possono visualizzare questa categoria e le figlie" | ||
|
||
#. module: document_page_group | ||
#: model:ir.model.fields,field_description:document_page_group.field_document_page__direct_group_ids | ||
msgid "Visible to" | ||
msgstr "Visibile a" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
# Translation of Odoo Server. | ||
# This file contains the translation of the following modules: | ||
# * document_page_group | ||
# | ||
msgid "" | ||
msgstr "" | ||
"Project-Id-Version: Odoo Server 16.0\n" | ||
"Report-Msgid-Bugs-To: \n" | ||
"PO-Revision-Date: 2024-02-28 21:33+0000\n" | ||
"Last-Translator: Peter Romão <[email protected]>\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 4.17\n" | ||
|
||
#. module: document_page_group | ||
#: model:ir.model,name:document_page_group.model_document_page | ||
msgid "Document Page" | ||
msgstr "Página do documento" | ||
|
||
#. module: document_page_group | ||
#: model:ir.model.fields,field_description:document_page_group.field_document_page__group_ids | ||
msgid "Group" | ||
msgstr "Grupo" | ||
|
||
#. module: document_page_group | ||
#: model:ir.model.fields,help:document_page_group.field_document_page__direct_group_ids | ||
msgid "Set the groups that can view this category and its childs" | ||
msgstr "Definir os grupos que podem exibir esta categoria e seus descendentes" | ||
|
||
#. module: document_page_group | ||
#: model:ir.model.fields,field_description:document_page_group.field_document_page__direct_group_ids | ||
msgid "Visible to" | ||
msgstr "Visível para" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
# Translation of Odoo Server. | ||
# This file contains the translation of the following modules: | ||
# * document_page_group | ||
# | ||
msgid "" | ||
msgstr "" | ||
"Project-Id-Version: Odoo Server 12.0\n" | ||
"Report-Msgid-Bugs-To: \n" | ||
"PO-Revision-Date: 2020-03-21 11:13+0000\n" | ||
"Last-Translator: Matjaz Mozetic <[email protected]>\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 3.10\n" | ||
|
||
#. module: document_page_group | ||
#: model:ir.model,name:document_page_group.model_document_page | ||
msgid "Document Page" | ||
msgstr "Stran dokumenta" | ||
|
||
#. module: document_page_group | ||
#: model:ir.model.fields,field_description:document_page_group.field_document_page__group_ids | ||
msgid "Group" | ||
msgstr "Skupina" | ||
|
||
#. module: document_page_group | ||
#: model:ir.model.fields,help:document_page_group.field_document_page__direct_group_ids | ||
msgid "Set the groups that can view this category and its childs" | ||
msgstr "Nastavi skupine z vpogledom v to kategorijo in njej podrejenim" | ||
|
||
#. module: document_page_group | ||
#: model:ir.model.fields,field_description:document_page_group.field_document_page__direct_group_ids | ||
msgid "Visible to" | ||
msgstr "Vidno za" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
from . import document_page |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
# Copyright 2019 Creu Blanca | ||
# 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" | ||
|
||
group_ids = fields.Many2many( | ||
"res.groups", | ||
store=True, | ||
recursive=True, | ||
relation="document_page_direct_group", | ||
column1="document_page_id", | ||
column2="group_id", | ||
compute="_compute_group_ids", | ||
) | ||
direct_group_ids = fields.Many2many( | ||
"res.groups", | ||
string="Visible to", | ||
help="Set the groups that can view this category and its childs", | ||
relation="document_page_group", | ||
column1="document_page_id", | ||
column2="group_id", | ||
) | ||
|
||
@api.depends("direct_group_ids", "parent_id", "parent_id.group_ids") | ||
def _compute_group_ids(self): | ||
for record in self: | ||
groups = record.direct_group_ids | ||
if record.parent_id: | ||
groups |= record.parent_id.group_ids | ||
record.group_ids = groups |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
[build-system] | ||
requires = ["whool"] | ||
build-backend = "whool.buildapi" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
- Enric Tobella \<<[email protected]>\> | ||
- \[APSL-Nagarro\](<https://apsl.tech>): | ||
- Antoni Marroig \<<[email protected]>\> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
This module allows to define groups on a category. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
<?xml version="1.0" encoding="utf-8" ?> | ||
<odoo> | ||
<record model="ir.rule" id="document_page_groups_rule"> | ||
<field name="name">document_page groups</field> | ||
<field name="model_id" ref="model_document_page" /> | ||
<field name="global" eval="True" /> | ||
<field | ||
name="domain_force" | ||
>['|','&',('type', '=', 'content'),'|','|',('parent_id', '=', False), ('parent_id.group_ids','=',False),('parent_id.group_ids.users','=',user.id), '&', ('type', '=', 'category'), '|', ('group_ids', '=', False), ('group_ids.users', '=', user.id)]</field> | ||
</record> | ||
</odoo> |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Oops, something went wrong.