ir_attachment_views.xml 5.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104
  1. <?xml version="1.0" encoding="utf-8"?>
  2. <odoo>
  3. <!-- Attachment -->
  4. <record id="view_attachment_form" model="ir.ui.view">
  5. <field name="model">ir.attachment</field>
  6. <field name="arch" type="xml">
  7. <form string="Attachments">
  8. <sheet>
  9. <label for="name"/>
  10. <h1>
  11. <field name="name"/>
  12. </h1>
  13. <group>
  14. <group>
  15. <field name="type"/>
  16. <field name="datas" filename="name" attrs="{'invisible':[('type','=','url')]}"/>
  17. <field name="url" widget="url" attrs="{'invisible':[('type','=','binary')]}"/>
  18. <field name="mimetype" groups="base.group_no_one"/>
  19. </group>
  20. <group string="Attached To" groups="base.group_no_one">
  21. <field name="res_model"/>
  22. <field name="res_field"/>
  23. <field name="res_id"/>
  24. <field name="res_name"/>
  25. <field name="company_id" groups="base.group_multi_company" options="{'no_create': True}"/>
  26. <field name="public"/>
  27. </group>
  28. <group string="History" groups="base.group_no_one" attrs="{'invisible':[('create_date','=',False)]}">
  29. <label for="create_uid" string="Creation"/>
  30. <div name="creation_div">
  31. <field name="create_uid" readonly="1" class="oe_inline"/> on
  32. <field name="create_date" readonly="1" class="oe_inline"/>
  33. </div>
  34. </group>
  35. <group name="description_group" string="Description" groups="base.group_no_one" colspan="4">
  36. <field name="description" nolabel="1" colspan="2"/>
  37. </group>
  38. <group groups="base.group_no_one" string="Indexed Content" colspan="4">
  39. <field name="index_content" nolabel="1" colspan="2"/>
  40. </group>
  41. </group>
  42. </sheet>
  43. </form>
  44. </field>
  45. </record>
  46. <record id="view_attachment_tree" model="ir.ui.view">
  47. <field name="model">ir.attachment</field>
  48. <field name="arch" type="xml">
  49. <tree string="Attachments">
  50. <field name="name"/>
  51. <field name="res_model"/>
  52. <field name="res_field"/>
  53. <field name="res_id"/>
  54. <field name="type"/>
  55. <field name="file_size"/>
  56. <field name="company_id" groups="base.group_multi_company"/>
  57. <field name="create_uid"/>
  58. <field name="create_date"/>
  59. </tree>
  60. </field>
  61. </record>
  62. <record id="view_attachment_search" model="ir.ui.view">
  63. <field name="model">ir.attachment</field>
  64. <field name="arch" type="xml">
  65. <search string="Attachments">
  66. <field name="name" filter_domain="[('name','ilike',self)]" string="Attachment"/>
  67. <field name="create_date"/>
  68. <filter name="my_documents_filter"
  69. string="My Document(s)"
  70. domain="[('create_uid','=',uid)]"
  71. help="Filter on my documents"/>
  72. <filter name="url_filter" string="URL" domain="[('type', '=', 'url')]"/>
  73. <filter name="binary_filter" string="Stored" domain="[('type', '=', 'binary')]"/>
  74. <separator/>
  75. <field name="create_uid" string="Created by"/>
  76. <field name="type"/>
  77. <group expand="0" string="Group By">
  78. <filter name="owner" string="Owner" domain="[]" context="{'group_by':'create_uid'}"/>
  79. <filter string="Type" name="type" domain="[]" context="{'group_by':'type'}" groups="base.group_no_one"/>
  80. <filter string="Company" name="company" domain="[]" context="{'group_by':'company_id'}" groups="base.group_multi_company"/>
  81. <filter string="Creation Date" name="creation_month" domain="[]" context="{'group_by':'create_date'}"/>
  82. </group>
  83. </search>
  84. </field>
  85. </record>
  86. <record id="action_attachment" model="ir.actions.act_window">
  87. <field name="name">Attachments</field>
  88. <field name="type">ir.actions.act_window</field>
  89. <field name="res_model">ir.attachment</field>
  90. <field name="view_id" eval="False"/>
  91. <field name="search_view_id" ref="view_attachment_search"/>
  92. <field name="help" type="html">
  93. <p class="o_view_nocontent_smiling_face">
  94. Create a new document
  95. </p>
  96. <p>
  97. Also you will find here all the related documents and download it by clicking on any individual document.
  98. </p>
  99. </field>
  100. </record>
  101. <menuitem action="action_attachment" id="menu_action_attachment" parent="base.next_id_9"/>
  102. </odoo>