From 65b8d51d77051307cbc7b0038abb66603a62c677 Mon Sep 17 00:00:00 2001 From: Alessandro Uffreduzzi Date: Mon, 20 Mar 2023 12:58:20 +0100 Subject: [PATCH] [14.0][FIX] document_page_project: fix permissions for project users Before this PR, users who could see projects but not knowledge were unable to access any project page due to the new fields linking knowledge documents and projects. --- document_page_project/models/project_project.py | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/document_page_project/models/project_project.py b/document_page_project/models/project_project.py index 259fdf5d..523db5fa 100644 --- a/document_page_project/models/project_project.py +++ b/document_page_project/models/project_project.py @@ -8,9 +8,16 @@ class ProjectProject(models.Model): _inherit = "project.project" document_page_ids = fields.One2many( - string="Wiki", comodel_name="document.page", inverse_name="project_id" + string="Wiki", + comodel_name="document.page", + inverse_name="project_id", + groups="knowledge.group_document_user", + ) + + document_page_count = fields.Integer( + compute="_compute_document_page_count", + groups="knowledge.group_document_user", ) - document_page_count = fields.Integer(compute="_compute_document_page_count") def _compute_document_page_count(self): for rec in self: