Skip to content

Commit

Permalink
[FIX] dms_partner_attachment_link: restricted file creation and uploa…
Browse files Browse the repository at this point in the history
…d when view was opened via partner form
  • Loading branch information
Dmytro committed Jul 15, 2024
1 parent 63b2fbe commit c1e2297
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 0 deletions.
7 changes: 7 additions & 0 deletions dms_partner_attachment_link/models/res_partner.py
Original file line number Diff line number Diff line change
Expand Up @@ -102,13 +102,20 @@ 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),
],
"kanban_view_ref": self.env.ref(
"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
12 changes: 12 additions & 0 deletions dms_partner_attachment_link/views/dms_file_views.xml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
<field name="mode">primary</field>
<field name="arch" type="xml">
<xpath expr="//kanban" position="attributes">
<attribute name="js_class" />
<attribute
name="class"
>o_kanban_small_column align-content-start</attribute>
Expand All @@ -16,4 +17,15 @@
</field>
</record>

<record id="view_dms_file_tree_inherit_partner_link" model="ir.ui.view">
<field name="name">res.partner.view.tree.inherit</field>
<field name="model">res.partner</field>
<field name="inherit_id" ref="dms.view_dms_file_tree" />
<field name="arch" type="xml">
<xpath expr="//tree" position="attributes">
<attribute name="js_class" />
</xpath>
</field>
</record>

</odoo>

0 comments on commit c1e2297

Please sign in to comment.