Make document type smart button open its attachments

This commit is contained in:
Leonardo Donelli 2017-02-03 10:24:04 +01:00
parent 5369b52ed6
commit 9f8ca75e57
3 changed files with 15 additions and 2 deletions

View File

@ -51,6 +51,11 @@ Contributors
* Leonardo Donelli @ MONK Software (leonardo.donelli@monksoftware.it)
Acknowledgements
----------------
* Thanks to gingitsune for showing me a simple way to open a 'Save and Close' dialog
Maintainer
----------

View File

@ -22,7 +22,7 @@
</record>
<record id="ir_attachment_view_search_document_type" model="ir.ui.view">
<field name="name"></field>
<field name="name">Attachment search view: add document type filter and groupby</field>
<field name="model">ir.attachment</field>
<field name="inherit_id" ref="base.view_attachment_search"/>
<field name="arch" type="xml">

View File

@ -7,6 +7,14 @@
<field name="view_mode">tree,form</field>
</record>
<record id="ir_attachment_action_document_type" model="ir.actions.act_window">
<field name="name">Documents</field>
<field name="res_model">ir.attachment</field>
<field name="view_type">form</field>
<field name="view_mode">tree,form</field>
<field name="context">{'search_default_document_type_id': [active_id], 'default_document_type_id': active_id}</field>
</record>
<record id="document_type_view_form" model="ir.ui.view">
<field name="name">Document types list view</field>
<field name="model">document.type</field>
@ -14,7 +22,7 @@
<form>
<sheet>
<div class="oe_button_box" name="button_box">
<button name="documents" class="oe_stat_button" icon="fa-book">
<button name="%(ir_attachment_action_document_type)d" type="action" class="oe_stat_button" icon="fa-book">
<field name="documents_count" string="Documents" widget="statinfo"/>
</button>
</div>