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.

150 lines
6.1 KiB

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