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.

145 lines
5.8 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="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. </group>
  53. <group string="Preview">
  54. <field name="image_medium"
  55. widget="image"
  56. readonly="True"
  57. nolabel="1" />
  58. </group>
  59. </group>
  60. <group string="Comments">
  61. <field name="comments" nolabel="1" />
  62. </group>
  63. </sheet>
  64. </form>
  65. </field>
  66. </record>
  67. <record id="image_tree_view" model="ir.ui.view">
  68. <field name="name">Multi image tree</field>
  69. <field name="model">base_multi_image.image</field>
  70. <field name="arch" type="xml">
  71. <tree string="Images">
  72. <field name="name"/>
  73. <field name="storage"/>
  74. <field name="owner_model"/>
  75. <field name="owner_id"/>
  76. <field name="sequence" invisible="True"/>
  77. </tree>
  78. </field>
  79. </record>
  80. <record id="image_kanban_view" model="ir.ui.view">
  81. <field name="name">Product multi image kanban</field>
  82. <field name="model">base_multi_image.image</field>
  83. <field name="arch" type="xml">
  84. <kanban string="Product Images">
  85. <field name="name"/>
  86. <field name="storage"/>
  87. <field name="sequence"/>
  88. <templates>
  89. <t t-name="kanban-box">
  90. <div style="position: relative">
  91. <a t-if="! read_only_mode"
  92. type="delete"
  93. style="position: absolute; right: 0; padding: 4px; diplay: inline-block">X</a>
  94. <div class="oe_module_vignette">
  95. <a type="open">
  96. <img
  97. t-att-src="kanban_image(
  98. 'base_multi_image.image',
  99. 'image_small',
  100. record.id.value)"
  101. class="oe_kanban_image"/>
  102. </a>
  103. <div class="oe_module_desc">
  104. <div class="oe_kanban_box_content oe_kanban_color_bglight oe_kanban_color_border">
  105. <table class="oe_kanban_table">
  106. <tr>
  107. <td class="oe_kanban_title1"
  108. align="left"
  109. valign="middle">
  110. <h4>
  111. <a type="open">
  112. <field name="name"/>
  113. </a>
  114. </h4>
  115. <field name="storage"/>
  116. </td>
  117. </tr>
  118. </table>
  119. </div>
  120. </div>
  121. </div>
  122. </div>
  123. </t>
  124. </templates>
  125. </kanban>
  126. </field>
  127. </record>
  128. <record id="image_action" model="ir.actions.act_window">
  129. <field name="name">Multi images</field>
  130. <field name="res_model">base_multi_image.image</field>
  131. <field name="view_mode">kanban,tree,form</field>
  132. <field name="help">Click to add an image attached to an specific record.</field>
  133. </record>
  134. <menuitem
  135. id="image_menu"
  136. action="image_action"
  137. parent="base.menu_custom"/>
  138. </data>
  139. </openerp>