From bcf2c25298ac2a890b4b2d8bf88f215948a4c0dd Mon Sep 17 00:00:00 2001 From: EdgarRetes Date: Wed, 6 Nov 2024 14:24:33 -0600 Subject: [PATCH] [FIX] document_page_approval: fixes --- document_page_approval/models/document_page.py | 5 +++-- document_page_approval/security/ir.model.access.csv | 1 - document_page_approval/views/document_page_approval.xml | 6 +++--- 3 files changed, 6 insertions(+), 6 deletions(-) delete mode 100644 document_page_approval/security/ir.model.access.csv diff --git a/document_page_approval/models/document_page.py b/document_page_approval/models/document_page.py index c8a321134a9..ccfcaa8795a 100644 --- a/document_page_approval/models/document_page.py +++ b/document_page_approval/models/document_page.py @@ -135,8 +135,9 @@ def _create_history(self, vals): def action_changes_pending_approval(self): self.ensure_one() - action = self.env.ref("document_page_approval.action_change_requests") - action = action.sudo().read()[0] + action = self.env["ir.actions.act_window"]._for_xml_id( + "document_page_approval.action_change_requests" + ) context = literal_eval(action["context"]) context["search_default_page_id"] = self.id context["default_page_id"] = self.id diff --git a/document_page_approval/security/ir.model.access.csv b/document_page_approval/security/ir.model.access.csv deleted file mode 100644 index 97dd8b917b8..00000000000 --- a/document_page_approval/security/ir.model.access.csv +++ /dev/null @@ -1 +0,0 @@ -id,name,model_id:id,group_id:id,perm_read,perm_write,perm_create,perm_unlink diff --git a/document_page_approval/views/document_page_approval.xml b/document_page_approval/views/document_page_approval.xml index 8f88f8ef489..4451403e8d6 100644 --- a/document_page_approval/views/document_page_approval.xml +++ b/document_page_approval/views/document_page_approval.xml @@ -14,7 +14,7 @@ type="object" string="Send to Review" class="oe_highlight" - invisible="not is_approval_required or not am_i_owner or state not in 'draft'" + invisible="not is_approval_required or not am_i_owner or state != 'draft'" />