From 5c153b9ebd9b6b098ff4eb1bcf94f6065e1b7222 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?V=C3=ADctor=20Mart=C3=ADnez?=
Date: Tue, 23 Jul 2024 17:32:06 +0200
Subject: [PATCH 1/2] [IMP] document_page_access_group: Users compatibility
TT48786
---
document_page_access_group/README.rst | 16 +++----
document_page_access_group/__manifest__.py | 2 +-
.../i18n/document_page_access_group.pot | 16 +++++++
document_page_access_group/i18n/es.po | 26 ++++++-----
.../16.0.1.1.0/noupdate_changes.xml | 8 ++++
.../migrations/16.0.1.1.0/post-migration.py | 12 +++++
.../models/document_page.py | 11 ++++-
.../readme/CONTRIBUTORS.rst | 4 ++
document_page_access_group/readme/USAGE.rst | 12 ++---
.../security/security.xml | 2 +-
.../static/description/index.html | 15 ++++---
document_page_access_group/tests/common.py | 37 ++++++++++++++++
.../tests/test_document_page_access_group.py | 44 +++++++++----------
.../views/document_page.xml | 16 ++++++-
14 files changed, 160 insertions(+), 61 deletions(-)
create mode 100644 document_page_access_group/migrations/16.0.1.1.0/noupdate_changes.xml
create mode 100644 document_page_access_group/migrations/16.0.1.1.0/post-migration.py
create mode 100644 document_page_access_group/tests/common.py
diff --git a/document_page_access_group/README.rst b/document_page_access_group/README.rst
index 0d4023d5..622b882c 100644
--- a/document_page_access_group/README.rst
+++ b/document_page_access_group/README.rst
@@ -40,14 +40,10 @@ Usage
=====
To select the users that have access to a given document page
-you need to open a document, go to the 'Security' tab
-and select which groups will have access.
-
-Only users that belong to the 'document_knowledge / Manager' group can
-manage access groups to documents.
-
-If no groups are selected in a document, all users that can access
-document pages can access this document.
+you need to open a document, go to the 'Security' tab and you have 3 options:
+- Select a group: Only users with those groups will be able to see the page.
+- Select any user: Only the selected users will be able to see the page.
+- Do not select group or user: All users will be able to see the page.
Bug Tracker
===========
@@ -73,6 +69,10 @@ Contributors
* Manuel Regidor
* Alberto Martínez
+* `Tecnativa `_:
+
+ * Víctor Martínez
+
Maintainers
~~~~~~~~~~~
diff --git a/document_page_access_group/__manifest__.py b/document_page_access_group/__manifest__.py
index 5ee5e1d3..64ba0479 100644
--- a/document_page_access_group/__manifest__.py
+++ b/document_page_access_group/__manifest__.py
@@ -4,7 +4,7 @@
{
"name": "Document Page Access Group",
"summary": "Choose groups to access document pages",
- "version": "16.0.1.0.0",
+ "version": "16.0.1.1.0",
"category": "document_knowledge",
"website": "https://github.com/OCA/knowledge",
"author": "Sygel, Odoo Community Association (OCA)",
diff --git a/document_page_access_group/i18n/document_page_access_group.pot b/document_page_access_group/i18n/document_page_access_group.pot
index 1b8462e8..46b9abb7 100644
--- a/document_page_access_group/i18n/document_page_access_group.pot
+++ b/document_page_access_group/i18n/document_page_access_group.pot
@@ -6,6 +6,8 @@ msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 16.0\n"
"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2024-07-24 07:09+0000\n"
+"PO-Revision-Date: 2024-07-24 07:09+0000\n"
"Last-Translator: \n"
"Language-Team: \n"
"MIME-Version: 1.0\n"
@@ -20,6 +22,7 @@ msgstr ""
#. module: document_page_access_group
#: model:ir.model.fields,field_description:document_page_access_group.field_document_page__groups_id
+#: model_terms:ir.ui.view,arch_db:document_page_access_group.document_page_access_group_view_wiki_form
msgid "Groups"
msgstr ""
@@ -27,3 +30,16 @@ msgstr ""
#: model_terms:ir.ui.view,arch_db:document_page_access_group.document_page_access_group_view_wiki_form
msgid "Security"
msgstr ""
+
+#. module: document_page_access_group
+#: model:ir.model.fields,field_description:document_page_access_group.field_document_page__user_ids
+#: model_terms:ir.ui.view,arch_db:document_page_access_group.document_page_access_group_view_wiki_form
+msgid "Users"
+msgstr ""
+
+#. module: document_page_access_group
+#. odoo-python
+#: code:addons/document_page_access_group/models/document_page.py:0
+#, python-format
+msgid "You cannot set groups and users at the same time."
+msgstr ""
diff --git a/document_page_access_group/i18n/es.po b/document_page_access_group/i18n/es.po
index 6bcd96e5..0ba00b9c 100644
--- a/document_page_access_group/i18n/es.po
+++ b/document_page_access_group/i18n/es.po
@@ -6,15 +6,16 @@ msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 14.0\n"
"Report-Msgid-Bugs-To: \n"
-"PO-Revision-Date: 2023-06-05 13:08+0000\n"
+"POT-Creation-Date: 2024-07-24 07:09+0000\n"
+"PO-Revision-Date: 2024-07-24 09:10+0200\n"
"Last-Translator: luis-ron \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"
+"Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=2; plural=n != 1;\n"
-"X-Generator: Weblate 4.17\n"
+"X-Generator: Poedit 3.0.1\n"
#. module: document_page_access_group
#: model:ir.model,name:document_page_access_group.model_document_page
@@ -23,6 +24,7 @@ msgstr "Página de documento"
#. module: document_page_access_group
#: model:ir.model.fields,field_description:document_page_access_group.field_document_page__groups_id
+#: model_terms:ir.ui.view,arch_db:document_page_access_group.document_page_access_group_view_wiki_form
msgid "Groups"
msgstr "Grupos"
@@ -31,11 +33,15 @@ msgstr "Grupos"
msgid "Security"
msgstr "Seguridad"
-#~ msgid "Display Name"
-#~ msgstr "Nombre mostrado"
+#. module: document_page_access_group
+#: model:ir.model.fields,field_description:document_page_access_group.field_document_page__user_ids
+#: model_terms:ir.ui.view,arch_db:document_page_access_group.document_page_access_group_view_wiki_form
+msgid "Users"
+msgstr "Usuarios"
-#~ msgid "ID"
-#~ msgstr "ID"
-
-#~ msgid "Last Modified on"
-#~ msgstr "Última modificación el"
+#. module: document_page_access_group
+#. odoo-python
+#: code:addons/document_page_access_group/models/document_page.py:0
+#, python-format
+msgid "You cannot set groups and users at the same time."
+msgstr "No puedes definir grupos y usuarios al mismo tiempo."
diff --git a/document_page_access_group/migrations/16.0.1.1.0/noupdate_changes.xml b/document_page_access_group/migrations/16.0.1.1.0/noupdate_changes.xml
new file mode 100644
index 00000000..185dcbb3
--- /dev/null
+++ b/document_page_access_group/migrations/16.0.1.1.0/noupdate_changes.xml
@@ -0,0 +1,8 @@
+
+
+
+ ['|', ('groups_id', 'in', [g.id for g in user.groups_id]), '|', ('user_ids', 'in', [user.id]), '&', ('groups_id', '=', False), ('user_ids', '=', False)]
+
+
diff --git a/document_page_access_group/migrations/16.0.1.1.0/post-migration.py b/document_page_access_group/migrations/16.0.1.1.0/post-migration.py
new file mode 100644
index 00000000..b99ca184
--- /dev/null
+++ b/document_page_access_group/migrations/16.0.1.1.0/post-migration.py
@@ -0,0 +1,12 @@
+# Copyright 2024 Tecnativa - Víctor Martínez
+# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
+from openupgradelib import openupgrade
+
+
+@openupgrade.migrate()
+def migrate(env, version):
+ openupgrade.load_data(
+ env.cr,
+ "document_page_access_group",
+ "migrations/16.0.1.1.0/noupdate_changes.xml",
+ )
diff --git a/document_page_access_group/models/document_page.py b/document_page_access_group/models/document_page.py
index e8ff91e9..84279501 100644
--- a/document_page_access_group/models/document_page.py
+++ b/document_page_access_group/models/document_page.py
@@ -1,10 +1,19 @@
# Copyright 2022 Manuel Regidor
+# Copyright 2024 Tecnativa - Víctor Martínez
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).
-from odoo import fields, models
+from odoo import _, api, fields, models
+from odoo.exceptions import UserError
class DocumentPage(models.Model):
_inherit = "document.page"
groups_id = fields.Many2many(comodel_name="res.groups", string="Groups")
+ user_ids = fields.Many2many(comodel_name="res.users", string="Users")
+
+ @api.constrains("groups_id", "user_ids")
+ def check_document_page_groups_users(self):
+ for _item in self.filtered(lambda x: x.groups_id and x.user_ids):
+ raise UserError(_("You cannot set groups and users at the same time."))
+ return True
diff --git a/document_page_access_group/readme/CONTRIBUTORS.rst b/document_page_access_group/readme/CONTRIBUTORS.rst
index 947896f8..6317bb1d 100644
--- a/document_page_access_group/readme/CONTRIBUTORS.rst
+++ b/document_page_access_group/readme/CONTRIBUTORS.rst
@@ -1,2 +1,6 @@
* Manuel Regidor
* Alberto Martínez
+
+* `Tecnativa `_:
+
+ * Víctor Martínez
diff --git a/document_page_access_group/readme/USAGE.rst b/document_page_access_group/readme/USAGE.rst
index f70e551e..bbe9bdb9 100644
--- a/document_page_access_group/readme/USAGE.rst
+++ b/document_page_access_group/readme/USAGE.rst
@@ -1,9 +1,5 @@
To select the users that have access to a given document page
-you need to open a document, go to the 'Security' tab
-and select which groups will have access.
-
-Only users that belong to the 'document_knowledge / Manager' group can
-manage access groups to documents.
-
-If no groups are selected in a document, all users that can access
-document pages can access this document.
+you need to open a document, go to the 'Security' tab and you have 3 options:
+- Select a group: Only users with those groups will be able to see the page.
+- Select any user: Only the selected users will be able to see the page.
+- Do not select group or user: All users will be able to see the page.
diff --git a/document_page_access_group/security/security.xml b/document_page_access_group/security/security.xml
index b35fa135..c7e20cbf 100644
--- a/document_page_access_group/security/security.xml
+++ b/document_page_access_group/security/security.xml
@@ -12,7 +12,7 @@
/>
['|', ('groups_id', '=', False), ('groups_id', 'in', [g.id for g in user.groups_id])]
+ >['|', ('groups_id', 'in', [g.id for g in user.groups_id]), '|', ('user_ids', 'in', [user.id]), '&', ('groups_id', '=', False), ('user_ids', '=', False)]
Document Page Full Access
diff --git a/document_page_access_group/static/description/index.html b/document_page_access_group/static/description/index.html
index d7141e98..d84ab6e6 100644
--- a/document_page_access_group/static/description/index.html
+++ b/document_page_access_group/static/description/index.html
@@ -1,4 +1,3 @@
-
@@ -388,12 +387,10 @@ document pages.
To select the users that have access to a given document page
-you need to open a document, go to the ‘Security’ tab
-and select which groups will have access.
-
Only users that belong to the ‘document_knowledge / Manager’ group can
-manage access groups to documents.
-
If no groups are selected in a document, all users that can access
-document pages can access this document.
+you need to open a document, go to the ‘Security’ tab and you have 3 options:
+- Select a group: Only users with those groups will be able to see the page.
+- Select any user: Only the selected users will be able to see the page.
+- Do not select group or user: All users will be able to see the page.
@@ -416,6 +413,10 @@ If you spotted it first, help us to smash it by providing a detailed and welcome
diff --git a/document_page_access_group/tests/common.py b/document_page_access_group/tests/common.py
new file mode 100644
index 00000000..1f92d881
--- /dev/null
+++ b/document_page_access_group/tests/common.py
@@ -0,0 +1,37 @@
+# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
+from odoo.tests import new_test_user
+
+from odoo.addons.base.tests.common import BaseCommon
+
+
+class TestDocumentPageAccessGroupBase(BaseCommon):
+ @classmethod
+ def setUpClass(cls):
+ super().setUpClass()
+ cls.group = cls.env["res.groups"].create({"name": "Test group"})
+ cls.user = new_test_user(
+ cls.env, login="test-user", groups="document_knowledge.group_document_user"
+ )
+ cls.manager_user = new_test_user(
+ cls.env,
+ login="test-manager-user",
+ groups="document_knowledge.group_document_user",
+ )
+ cls.manager_user.write({"groups_id": [(4, cls.group.id)]})
+ cls.public_page = cls.env["document.page"].create(
+ {"name": "Public Page", "type": "content"}
+ )
+ cls.knowledge_page = cls.env["document.page"].create(
+ {
+ "name": "Knowledge Page",
+ "type": "content",
+ "groups_id": [(6, 0, [cls.group.id])],
+ }
+ )
+ cls.user_page = cls.env["document.page"].create(
+ {
+ "name": "User Page (basic user)",
+ "type": "content",
+ "user_ids": [(6, 0, [cls.user.id])],
+ }
+ )
diff --git a/document_page_access_group/tests/test_document_page_access_group.py b/document_page_access_group/tests/test_document_page_access_group.py
index d0e0ccbd..3a1ec8c4 100644
--- a/document_page_access_group/tests/test_document_page_access_group.py
+++ b/document_page_access_group/tests/test_document_page_access_group.py
@@ -1,29 +1,25 @@
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
from odoo.exceptions import UserError
-from odoo.tests import common
+from odoo.tests.common import users
+
+from .common import TestDocumentPageAccessGroupBase
-class TestDocumentPageAccessGroup(common.TransactionCase):
- def setUp(self):
- super().setUp()
- self.document_user_group = self.browse_ref(
- "document_knowledge.group_document_user"
- ).id
- self.test_group = self.browse_ref("base.group_erp_manager").id
- self.user_id = self.env["res.users"].create(
- {
- "name": "user",
- "login": "user_login",
- "email": "user_email",
- "groups_id": [(4, self.document_user_group)],
- }
- )
- self.page = self.env["document.page"].create(
- {"name": "Page 1", "type": "content"}
- )
-
- def test_page_access(self):
- self.assertIsNone(self.page.with_user(self.user_id).check_access_rule("read"))
- self.page.write({"groups_id": [(4, self.test_group)]})
+class TestDocumentPageAccessGroup(TestDocumentPageAccessGroupBase):
+ def test_page_access_constrains(self):
with self.assertRaises(UserError):
- self.page.with_user(self.user_id).check_access_rule("read")
+ self.knowledge_page.write({"user_ids": [(6, 0, [self.user.id])]})
+
+ @users("test-user")
+ def test_page_access_01(self):
+ pages = self.env["document.page"].search([])
+ self.assertIn(self.public_page, pages)
+ self.assertNotIn(self.knowledge_page, pages)
+ self.assertIn(self.user_page, pages)
+
+ @users("test-manager-user")
+ def test_page_access_02(self):
+ pages = self.env["document.page"].search([])
+ self.assertIn(self.public_page, pages)
+ self.assertIn(self.knowledge_page, pages)
+ self.assertNotIn(self.user_page, pages)
diff --git a/document_page_access_group/views/document_page.xml b/document_page_access_group/views/document_page.xml
index b09cba7d..eab2f80b 100644
--- a/document_page_access_group/views/document_page.xml
+++ b/document_page_access_group/views/document_page.xml
@@ -1,5 +1,6 @@
@@ -13,7 +14,20 @@
string="Security"
groups="document_page.group_document_manager"
>
-
+
+
+
+
+
+
From e24658bf1152f593cc1989860f0d150bc6827521 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?V=C3=ADctor=20Mart=C3=ADnez?=
Date: Wed, 24 Jul 2024 08:55:20 +0200
Subject: [PATCH 2/2] [IMP] document_page_access_group_user_role: Users
compatibility
TT48786
---
.../README.rst | 2 +-
.../__manifest__.py | 2 +-
.../migrations/16.0.1.1.0/post-migration.py | 13 +++++
.../models/document_page.py | 10 ++--
.../readme/USAGE.rst | 2 +-
.../static/description/index.html | 3 +-
...st_document_page_access_group_user_role.py | 55 ++++++++++++-------
.../views/document_page_views.xml | 23 ++++----
8 files changed, 68 insertions(+), 42 deletions(-)
create mode 100644 document_page_access_group_user_role/migrations/16.0.1.1.0/post-migration.py
diff --git a/document_page_access_group_user_role/README.rst b/document_page_access_group_user_role/README.rst
index da78eeab..8b160bc9 100644
--- a/document_page_access_group_user_role/README.rst
+++ b/document_page_access_group_user_role/README.rst
@@ -42,7 +42,7 @@ Usage
#. Go to `Knowledge / Pages` 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 any group(s).
-#. The role groups will have been added in the "Security" tab.
+#. The role users will have been added in the "Security" tab.
Bug Tracker
===========
diff --git a/document_page_access_group_user_role/__manifest__.py b/document_page_access_group_user_role/__manifest__.py
index 45f5a0fc..54a075cb 100644
--- a/document_page_access_group_user_role/__manifest__.py
+++ b/document_page_access_group_user_role/__manifest__.py
@@ -4,7 +4,7 @@
"name": "Document Page Access Group User Role",
"author": "Tecnativa, Odoo Community Association (OCA)",
"website": "https://github.com/OCA/knowledge",
- "version": "16.0.1.0.0",
+ "version": "16.0.1.1.0",
"depends": ["document_page_access_group", "base_user_role"],
"license": "AGPL-3",
"category": "Knowledge",
diff --git a/document_page_access_group_user_role/migrations/16.0.1.1.0/post-migration.py b/document_page_access_group_user_role/migrations/16.0.1.1.0/post-migration.py
new file mode 100644
index 00000000..20d09318
--- /dev/null
+++ b/document_page_access_group_user_role/migrations/16.0.1.1.0/post-migration.py
@@ -0,0 +1,13 @@
+# Copyright 2024 Tecnativa - Víctor Martínez
+# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
+from openupgradelib import openupgrade
+
+
+@openupgrade.migrate()
+def migrate(env, version):
+ """Pages that had roles should now have the correct users."""
+ pages = env["document.page"].sudo().search([("role_ids", "!=", False)])
+ for page in pages:
+ users = page.mapped("role_ids.users")
+ page.role_ids = False
+ page.user_ids = users
diff --git a/document_page_access_group_user_role/models/document_page.py b/document_page_access_group_user_role/models/document_page.py
index f9bf89cf..a4db0ed0 100644
--- a/document_page_access_group_user_role/models/document_page.py
+++ b/document_page_access_group_user_role/models/document_page.py
@@ -7,7 +7,7 @@ from odoo import api, fields, models
class DocumentPage(models.Model):
_inherit = "document.page"
- groups_id = fields.Many2many(compute="_compute_groups_id", store=True)
+ 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",
@@ -16,8 +16,8 @@ class DocumentPage(models.Model):
string="Roles",
)
- @api.depends("role_ids", "role_ids.implied_ids")
- def _compute_groups_id(self):
- """Create a compute to auto-set all the groups of the related roles."""
+ @api.depends("role_ids", "role_ids.users")
+ def _compute_user_ids(self):
+ """Create a compute to auto-set all the users of the related roles."""
for item in self:
- item.groups_id = item.mapped("role_ids.implied_ids")
+ item.user_ids += item.mapped("role_ids.users")
diff --git a/document_page_access_group_user_role/readme/USAGE.rst b/document_page_access_group_user_role/readme/USAGE.rst
index 568c9352..4d593dca 100644
--- a/document_page_access_group_user_role/readme/USAGE.rst
+++ b/document_page_access_group_user_role/readme/USAGE.rst
@@ -2,4 +2,4 @@
#. Go to `Knowledge / Pages` 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 any group(s).
-#. The role groups will have been added in the "Security" tab.
+#. The role users will have been added in the "Security" tab.
diff --git a/document_page_access_group_user_role/static/description/index.html b/document_page_access_group_user_role/static/description/index.html
index 60c98a6a..f725f4be 100644
--- a/document_page_access_group_user_role/static/description/index.html
+++ b/document_page_access_group_user_role/static/description/index.html
@@ -1,4 +1,3 @@
-
@@ -391,7 +390,7 @@ ul.auto-toc {
Go to Knowledge / Pages 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 any group(s).
-The role groups will have been added in the “Security” tab.
+The role users will have been added in the “Security” tab.
diff --git a/document_page_access_group_user_role/tests/test_document_page_access_group_user_role.py b/document_page_access_group_user_role/tests/test_document_page_access_group_user_role.py
index f830ee1d..777e2eaa 100644
--- a/document_page_access_group_user_role/tests/test_document_page_access_group_user_role.py
+++ b/document_page_access_group_user_role/tests/test_document_page_access_group_user_role.py
@@ -1,30 +1,47 @@
# Copyright 2024 Tecnativa - Víctor Martínez
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
+from odoo.tests.common import users
-from odoo.addons.base.tests.common import BaseCommon
+from odoo.addons.document_page_access_group.tests.common import (
+ TestDocumentPageAccessGroupBase,
+)
-class TestDocumentPageAccessGroupUserRole(BaseCommon):
+class TestDocumentPageAccessGroupUserRole(TestDocumentPageAccessGroupBase):
@classmethod
def setUpClass(cls):
super().setUpClass()
- cls.page = cls.env["document.page"].create(
- {"name": "Page 1", "type": "content"}
- )
- cls.group_a = cls.env["res.groups"].create({"name": "Test group A"})
- cls.group_b = cls.env["res.groups"].create({"name": "Test group B"})
cls.user_role = cls.env["res.users.role"].create(
- {"name": "Test role", "implied_ids": [(6, 0, [cls.group_a.id])]}
+ {
+ "name": "Test role",
+ "implied_ids": [(6, 0, [cls.group.id])],
+ "users": [(6, 0, [cls.manager_user.id])],
+ }
+ )
+ cls.role_page = cls.env["document.page"].create(
+ {
+ "name": "Role Page (test role)",
+ "type": "content",
+ "role_ids": [(6, 0, [cls.user_role.id])],
+ }
)
- def test_document_page_role(self):
- self.assertFalse(self.page.groups_id)
- self.page.role_ids = [(4, self.user_role.id)]
- self.assertIn(self.group_a, self.page.groups_id)
- self.assertNotIn(self.group_b, self.page.groups_id)
- self.user_role.implied_ids = [(4, self.group_b.id)]
- self.assertIn(self.group_a, self.page.groups_id)
- self.assertIn(self.group_b, self.page.groups_id)
- self.page.role_ids = [(6, 0, [])]
- self.assertNotIn(self.group_a, self.page.groups_id)
- self.assertNotIn(self.group_b, self.page.groups_id)
+ def test_document_page_role_misc(self):
+ self.assertFalse(self.role_page.groups_id)
+ self.assertTrue(self.role_page.user_ids)
+
+ @users("test-user")
+ def test_document_page_role_access_01(self):
+ pages = self.env["document.page"].search([])
+ self.assertIn(self.public_page, pages)
+ self.assertNotIn(self.knowledge_page, pages)
+ self.assertIn(self.user_page, pages)
+ self.assertNotIn(self.role_page, pages)
+
+ @users("test-manager-user")
+ def test_document_page_role_access_02(self):
+ pages = self.env["document.page"].search([])
+ self.assertIn(self.public_page, pages)
+ self.assertIn(self.knowledge_page, pages)
+ self.assertNotIn(self.user_page, pages)
+ self.assertIn(self.role_page, pages)
diff --git a/document_page_access_group_user_role/views/document_page_views.xml b/document_page_access_group_user_role/views/document_page_views.xml
index 2a0fe5ae..55506292 100644
--- a/document_page_access_group_user_role/views/document_page_views.xml
+++ b/document_page_access_group_user_role/views/document_page_views.xml
@@ -8,24 +8,21 @@
ref="document_page_access_group.document_page_access_group_view_wiki_form"
/>
-
-
-
+
+
+
-
-
-
-
-
-
- {'readonly': [('role_ids', '!=', [])]}
-
+
+