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.2 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="id"/>
  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-alt="record.name"
  105. t-att-src="kanban_image(
  106. 'base_multi_image.image',
  107. 'image_small',
  108. record.id.raw_value)"
  109. class="oe_kanban_image"/>
  110. </a>
  111. <div class="oe_module_desc">
  112. <div class="oe_kanban_box_content oe_kanban_color_bglight oe_kanban_color_border">
  113. <table class="oe_kanban_table">
  114. <tr>
  115. <td class="oe_kanban_title1"
  116. align="left"
  117. valign="middle">
  118. <h4>
  119. <a type="open">
  120. <field name="name"/>
  121. </a>
  122. </h4>
  123. <field name="storage"/>
  124. </td>
  125. </tr>
  126. </table>
  127. </div>
  128. </div>
  129. </div>
  130. </div>
  131. </t>
  132. </templates>
  133. </kanban>
  134. </field>
  135. </record>
  136. <record id="image_action" model="ir.actions.act_window">
  137. <field name="name">Multi images</field>
  138. <field name="res_model">base_multi_image.image</field>
  139. <field name="view_mode">kanban,tree,form</field>
  140. <field name="help">Click to add an image attached to an specific record.</field>
  141. </record>
  142. <menuitem
  143. id="image_menu"
  144. action="image_action"
  145. parent="base.menu_custom"/>
  146. </odoo>