From 5b7626805be19ec1d83de447ce348015273ba2d7 Mon Sep 17 00:00:00 2001 From: Dmytro <=> Date: Mon, 15 Jul 2024 08:19:11 +0300 Subject: [PATCH] [FIX] dms_partner_attachment_link: restricted file creation and upload when view was opened via partner form --- dms_partner_attachment_link/models/res_partner.py | 7 +++++++ .../views/dms_file_views.xml | 15 ++++++++++++++- 2 files changed, 21 insertions(+), 1 deletion(-) diff --git a/dms_partner_attachment_link/models/res_partner.py b/dms_partner_attachment_link/models/res_partner.py index e9aa5842a..2a46b0279 100644 --- a/dms_partner_attachment_link/models/res_partner.py +++ b/dms_partner_attachment_link/models/res_partner.py @@ -102,6 +102,9 @@ def action_open_dms_attachments(self): action = self.env.ref("dms.action_dms_file").read()[0] action.update( { + "context": { + "create": 0, + }, "domain": [ ("id", "in", self.dms_file_ids.ids), ], @@ -109,6 +112,10 @@ def action_open_dms_attachments(self): "dms_partner_attachment_link." "view_dms_file_kanban_inherit_partner_link" ).id, + "tree_view_ref": self.env.ref( + "dms_partner_attachment_link." + "view_dms_file_tree_inherit_partner_link" + ).id, } ) return action diff --git a/dms_partner_attachment_link/views/dms_file_views.xml b/dms_partner_attachment_link/views/dms_file_views.xml index fb37e4731..4f4bbed03 100644 --- a/dms_partner_attachment_link/views/dms_file_views.xml +++ b/dms_partner_attachment_link/views/dms_file_views.xml @@ -2,12 +2,13 @@ - dms.file.view.kanban.inherit + dms.file.view.kanban.inherit.partner.link dms.file primary + o_kanban_small_column align-content-start @@ -16,4 +17,16 @@ + + res.partner.view.tree.inherit.partner.link + res.partner + + primary + + + + + + +