You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

152 lines
6.1 KiB

  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <openerp>
  3. <data>
  4. <record id="image_form_view" model="ir.ui.view">
  5. <field name="name">Multi image form</field>
  6. <field name="model">base_multi_image.image</field>
  7. <field name="arch" type="xml">
  8. <form string="Image">
  9. <sheet>
  10. <group>
  11. <group
  12. string="Owner"
  13. attrs="{
  14. 'invisible': [
  15. ('show_technical', '=', False),
  16. ],
  17. }">
  18. <field name="show_technical" invisible="True"/>
  19. <field name="owner_model"/>
  20. <field name="owner_id"/>
  21. <field name="owner_ref_id"/>
  22. <field name="sequence"/>
  23. </group>
  24. <group string="Name">
  25. <field name="name"/>
  26. <field name="storage"/>
  27. <field name="extension"/>
  28. </group>
  29. </group>
  30. <group>
  31. <group string="Options">
  32. <field
  33. name="url"
  34. attrs="{
  35. 'invisible': [('storage', '!=', 'url')],
  36. 'required': [('storage', '=', 'url')],
  37. }"
  38. widget="url"/>
  39. <field
  40. name="path"
  41. attrs="{
  42. 'invisible': [('storage', '!=', 'file')],
  43. 'required': [('storage', '=', 'file')],
  44. }"/>
  45. <field name="filename" invisible="1"/>
  46. <field
  47. name="file_db_store"
  48. attrs="{
  49. 'invisible': [('storage', '!=', 'db')],
  50. 'required': [('storage', '=', 'db')],
  51. }"
  52. filename="filename"/>
  53. <field
  54. name="attachment_id"
  55. attrs="{
  56. 'invisible': [('storage', '!=', 'filestore')],
  57. 'required': [('storage', '=', 'filestore')],
  58. }"/>
  59. </group>
  60. <group string="Preview">
  61. <field name="image_medium"
  62. widget="image"
  63. readonly="True"
  64. nolabel="1" />
  65. </group>
  66. </group>
  67. <group string="Comments">
  68. <field name="comments" nolabel="1" />
  69. </group>
  70. </sheet>
  71. </form>
  72. </field>
  73. </record>
  74. <record id="image_tree_view" model="ir.ui.view">
  75. <field name="name">Multi image tree</field>
  76. <field name="model">base_multi_image.image</field>
  77. <field name="arch" type="xml">
  78. <tree string="Images">
  79. <field name="name"/>
  80. <field name="storage"/>
  81. <field name="owner_model"/>
  82. <field name="owner_id"/>
  83. <field name="sequence" invisible="True"/>
  84. </tree>
  85. </field>
  86. </record>
  87. <record id="image_kanban_view" model="ir.ui.view">
  88. <field name="name">Product multi image kanban</field>
  89. <field name="model">base_multi_image.image</field>
  90. <field name="arch" type="xml">
  91. <kanban string="Product Images">
  92. <field name="name"/>
  93. <field name="storage"/>
  94. <field name="sequence"/>
  95. <templates>
  96. <t t-name="kanban-box">
  97. <div style="position: relative">
  98. <a t-if="! read_only_mode"
  99. type="delete"
  100. style="position: absolute; right: 0; padding: 4px; diplay: inline-block">X</a>
  101. <div class="oe_module_vignette">
  102. <a type="open">
  103. <img
  104. t-att-src="kanban_image(
  105. 'base_multi_image.image',
  106. 'image_small',
  107. record.id.value)"
  108. class="oe_kanban_image"/>
  109. </a>
  110. <div class="oe_module_desc">
  111. <div class="oe_kanban_box_content oe_kanban_color_bglight oe_kanban_color_border">
  112. <table class="oe_kanban_table">
  113. <tr>
  114. <td class="oe_kanban_title1"
  115. align="left"
  116. valign="middle">
  117. <h4>
  118. <a type="open">
  119. <field name="name"/>
  120. </a>
  121. </h4>
  122. <field name="storage"/>
  123. </td>
  124. </tr>
  125. </table>
  126. </div>
  127. </div>
  128. </div>
  129. </div>
  130. </t>
  131. </templates>
  132. </kanban>
  133. </field>
  134. </record>
  135. <record id="image_action" model="ir.actions.act_window">
  136. <field name="name">Multi images</field>
  137. <field name="res_model">base_multi_image.image</field>
  138. <field name="view_mode">kanban,tree,form</field>
  139. <field name="help">Click to add an image attached to an specific record.</field>
  140. </record>
  141. <menuitem
  142. id="image_menu"
  143. action="image_action"
  144. parent="base.menu_custom"/>
  145. </data>
  146. </openerp>