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.

217 lines
9.3 KiB

4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
  1. <odoo>
  2. <data>
  3. <!-- Animal Tree View -->
  4. <record id="view_animal_tree" model="ir.ui.view">
  5. <field name="name">animal.tree</field>
  6. <field name="model">animal</field>
  7. <field name="arch" type="xml">
  8. <tree string="Animals">
  9. <field name="ref" />
  10. <field name="name" />
  11. <field name="gender" />
  12. <field name="species_id" />
  13. <field name="breed_id" />
  14. <field name="color_id" />
  15. </tree>
  16. </field>
  17. </record>
  18. <!-- Animal Form View -->
  19. <record id="view_animal_form" model="ir.ui.view">
  20. <field name="name">animal.form</field>
  21. <field name="model">animal</field>
  22. <field name="arch" type="xml">
  23. <form string="Animal">
  24. <sheet>
  25. <widget
  26. name="web_ribbon"
  27. title="Archived"
  28. bg_color="bg-danger"
  29. attrs="{'invisible': [('active', '=', True)]}"
  30. />
  31. <field name="active" invisible="1" />
  32. <field name="image" widget='image' class="oe_avatar" />
  33. <div class="oe_title">
  34. <h1>
  35. <field name="name" />
  36. </h1>
  37. <field
  38. name="gender"
  39. widget="radio"
  40. options="{'horizontal': true}"
  41. />
  42. </div>
  43. <group id="main">
  44. <group id="left">
  45. <field name="species_id" />
  46. <field
  47. name="breed_id"
  48. domain="[('species_id', '=', species_id)]"
  49. />
  50. <field
  51. name="color_id"
  52. domain="[('breed_id', '=', breed_id)]"
  53. />
  54. <field name="size" />
  55. </group>
  56. <group id="right">
  57. <field name="ref" />
  58. <field name="weight" />
  59. <field name="birth_date" />
  60. </group>
  61. </group>
  62. </sheet>
  63. <div class="oe_chatter">
  64. <field name="message_follower_ids" widget="mail_followers" />
  65. <field name="activity_ids" widget="mail_activity" />
  66. <field
  67. name="message_ids"
  68. widget="mail_thread"
  69. options="{'post_refresh': 'recipients'}"
  70. />
  71. </div>
  72. </form>
  73. </field>
  74. </record>
  75. <!-- Animal Kanban View -->
  76. <record id="view_animal_kanban" model="ir.ui.view">
  77. <field name="name">animal.kanban</field>
  78. <field name="model">animal</field>
  79. <field name="arch" type="xml">
  80. <kanban class="o_res_partner_kanban">
  81. <field name="id" />
  82. <field name="image" />
  83. <field name="name" />
  84. <templates>
  85. <t t-name="kanban-box">
  86. <div
  87. class="oe_kanban_global_click o_kanban_record_has_image_fill o_res_partner_kanban"
  88. >
  89. <t t-if="record.image.raw_value">
  90. <img
  91. class="o_kanban_image"
  92. t-att-src="kanban_image('animal', 'image', record.id.raw_value)"
  93. t-att-alt="record.name"
  94. />
  95. </t>
  96. <t t-else="">
  97. <img
  98. class="o_kanban_image"
  99. alt="Avatar"
  100. t-att-src='_s + "/animal/static/img/avatar.png"'
  101. />
  102. </t>
  103. <div class="oe_kanban_details">
  104. <strong
  105. class="o_kanban_record_title oe_partner_heading"
  106. >
  107. <field name="display_name" />
  108. </strong>
  109. <div
  110. class="o_kanban_tags_section oe_kanban_partner_categories"
  111. />
  112. <ul>
  113. <li t-if="record.gender.raw_value">
  114. <field name="gender" />
  115. </li>
  116. <li
  117. t-if="record.species_id.raw_value and record.breed_id.raw_value"
  118. >
  119. <field name="breed_id" />
  120. <field name="species_id" />
  121. </li>
  122. </ul>
  123. <div class="oe_kanban_partner_links" />
  124. </div>
  125. </div>
  126. </t>
  127. </templates>
  128. </kanban>
  129. </field>
  130. </record>
  131. <!-- Search for animal -->
  132. <record id="view_animal_search" model="ir.ui.view">
  133. <field name="name">animal.search</field>
  134. <field name="model">animal</field>
  135. <field name="arch" type="xml">
  136. <search string="Animals">
  137. <field
  138. name="name"
  139. filter_domain="['|', ('name', 'ilike', self), ('ref', 'ilike', self)]"
  140. string="Name"
  141. />
  142. <field name="species_id" />
  143. <field name="breed_id" />
  144. <field name="color_id" />
  145. <field name="size" />
  146. <separator />
  147. <filter
  148. string="Female"
  149. domain="[('gender', '=', 'female')]"
  150. name="female"
  151. />
  152. <filter
  153. string="Male"
  154. domain="[('gender', '=', 'male')]"
  155. name="male"
  156. />
  157. <filter
  158. string="Hermaphrodite"
  159. domain="[('gender', '=', 'hermaphrodite')]"
  160. name="hermaphrodite"
  161. />
  162. <filter
  163. string="Neutered"
  164. domain="[('gender', '=', 'neutered')]"
  165. name="neutered"
  166. />
  167. <separator />
  168. <filter
  169. string="Archived"
  170. name="inactive"
  171. domain="[('active', '=', False)]"
  172. />
  173. <separator />
  174. <group expand="0" string="Group By">
  175. <filter
  176. name="gender"
  177. string="Gender"
  178. domain=""
  179. context="{'group_by': 'gender'}"
  180. />
  181. <filter
  182. name="species_id"
  183. string="Species"
  184. domain=""
  185. context="{'group_by': 'species_id'}"
  186. />
  187. <filter
  188. name="breed_id"
  189. string="Breed"
  190. domain=""
  191. context="{'group_by': 'breed_id'}"
  192. />
  193. <filter
  194. name="color_id"
  195. string="Color"
  196. domain=""
  197. context="{'group_by': 'color_id'}"
  198. />
  199. </group>
  200. </search>
  201. </field>
  202. </record>
  203. <record id="action_animal" model="ir.actions.act_window">
  204. <field name="name">Animals</field>
  205. <field name="res_model">animal</field>
  206. <field name="view_mode">kanban,tree,form</field>
  207. <field name="search_view_id" ref="view_animal_search" />
  208. <field name="help" type="html">
  209. <p class="o_view_nocontent_smiling_face">Create an animal</p>
  210. </field>
  211. </record>
  212. </data>
  213. </odoo>