Skip to content

Commit

Permalink
Merge PR #489 into 17.0
Browse files Browse the repository at this point in the history
Signed-off-by StefanRijnhart
  • Loading branch information
OCA-git-bot committed Jul 4, 2024
2 parents 93bde61 + 0d0d164 commit a487660
Show file tree
Hide file tree
Showing 20 changed files with 856 additions and 0 deletions.
79 changes: 79 additions & 0 deletions document_page_group/README.rst
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.
1 change: 1 addition & 0 deletions document_page_group/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
from . import models
14 changes: 14 additions & 0 deletions document_page_group/__manifest__.py
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"],
}
34 changes: 34 additions & 0 deletions document_page_group/i18n/document_page_group.pot
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 ""
37 changes: 37 additions & 0 deletions document_page_group/i18n/es.po
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"
38 changes: 38 additions & 0 deletions document_page_group/i18n/hr.po
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"
37 changes: 37 additions & 0 deletions document_page_group/i18n/it.po
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"
37 changes: 37 additions & 0 deletions document_page_group/i18n/pt.po
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"
38 changes: 38 additions & 0 deletions document_page_group/i18n/sl.po
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"
1 change: 1 addition & 0 deletions document_page_group/models/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
from . import document_page
34 changes: 34 additions & 0 deletions document_page_group/models/document_page.py
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
3 changes: 3 additions & 0 deletions document_page_group/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 document_page_group/readme/CONTRIBUTORS.md
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]>\>
1 change: 1 addition & 0 deletions document_page_group/readme/DESCRIPTION.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
This module allows to define groups on a category.
11 changes: 11 additions & 0 deletions document_page_group/security/document_page_security.xml
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"
>['|','&amp;',('type', '=', 'content'),'|','|',('parent_id', '=', False), ('parent_id.group_ids','=',False),('parent_id.group_ids.users','=',user.id), '&amp;', ('type', '=', 'category'), '|', ('group_ids', '=', False), ('group_ids.users', '=', user.id)]</field>
</record>
</odoo>
Binary file added document_page_group/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

0 comments on commit a487660

Please sign in to comment.