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.

156 lines
7.0 KiB

4 years ago
  1. <odoo>
  2. <!-- Animal Tree View -->
  3. <record id="view_animal_tree" model="ir.ui.view">
  4. <field name="name">animal.tree</field>
  5. <field name="model">animal</field>
  6. <field name="arch" type="xml">
  7. <tree string="Animals">
  8. <field name="ref"/>
  9. <field name="name"/>
  10. <field name="gender"/>
  11. <field name="species_id"/>
  12. <field name="breed_id"/>
  13. <field name="color_id"/>
  14. </tree>
  15. </field>
  16. </record>
  17. <!-- Animal Form View -->
  18. <record id="view_animal_form" model="ir.ui.view">
  19. <field name="name">animal.form</field>
  20. <field name="model">animal</field>
  21. <field name="arch" type="xml">
  22. <form string="Animal">
  23. <header/>
  24. <sheet>
  25. <div class="oe_button_box" name="button_box">
  26. <button name="toggle_active" type="object"
  27. class="oe_stat_button" icon="fa-archive">
  28. <field name="active" widget="boolean_button"
  29. options='{"terminology": "archive"}'/>
  30. </button>
  31. </div>
  32. <field name="image" widget='image' class="oe_avatar"/>
  33. <div class="oe_title">
  34. <h1>
  35. <field name="name"/>
  36. </h1>
  37. <field name="gender" widget="radio"
  38. options="{'horizontal': true}"/>
  39. </div>
  40. <group id="main">
  41. <group id="left">
  42. <field name="species_id"/>
  43. <field name="breed_id" domain="[('species_id', '=', species_id)]"/>
  44. <field name="color_id" domain="[('breed_id', '=', breed_id)]"/>
  45. <field name="size"/>
  46. </group>
  47. <group id="right">
  48. <field name="ref"/>
  49. <field name="weight"/>
  50. <field name="birth_date"/>
  51. </group>
  52. </group>
  53. <notebook/>
  54. </sheet>
  55. <div class="oe_chatter">
  56. <field name="message_follower_ids"
  57. widget="mail_followers"/>
  58. <field name="activity_ids" widget="mail_activity"/>
  59. <field name="message_ids" widget="mail_thread"
  60. options="{'post_refresh': 'recipients'}"/>
  61. </div>
  62. </form>
  63. </field>
  64. </record>
  65. <!-- Animal Kanban View -->
  66. <record id="view_animal_kanban" model="ir.ui.view">
  67. <field name="name">animal.kanban</field>
  68. <field name="model">animal</field>
  69. <field name="arch" type="xml">
  70. <kanban class="o_res_partner_kanban">
  71. <field name="id"/>
  72. <field name="image"/>
  73. <field name="name"/>
  74. <templates>
  75. <t t-name="kanban-box">
  76. <div class="oe_kanban_global_click o_kanban_record_has_image_fill o_res_partner_kanban">
  77. <t t-if="record.image.raw_value">
  78. <img class="o_kanban_image" t-att-src="kanban_image('animal', 'image', record.id.raw_value)" t-att-alt="record.name"/>
  79. </t>
  80. <t t-else="">
  81. <img class="o_kanban_image" alt="Avatar" t-att-src='_s + "/animal/static/img/avatar.png"'/>
  82. </t>
  83. <div class="oe_kanban_details">
  84. <strong class="o_kanban_record_title oe_partner_heading"><field name="display_name"/></strong>
  85. <div class="o_kanban_tags_section oe_kanban_partner_categories"/>
  86. <ul>
  87. <li t-if="record.gender.raw_value"><field name="gender"/></li>
  88. <li t-if="record.species_id.raw_value and record.breed_id.raw_value"><field name="breed_id"/>, <field name="species_id"/></li>
  89. </ul>
  90. <div class="oe_kanban_partner_links"/>
  91. </div>
  92. </div>
  93. </t>
  94. </templates>
  95. </kanban>
  96. </field>
  97. </record>
  98. <!-- Search for animal -->
  99. <record id="view_animal_search" model="ir.ui.view">
  100. <field name="name">animal.search</field>
  101. <field name="model">animal</field>
  102. <field name="arch" type="xml">
  103. <search string="Animals">
  104. <field name="name"
  105. filter_domain="['|', ('name', 'ilike', self), ('ref', 'ilike', self)]"
  106. string="Name"/>
  107. <field name="species_id"/>
  108. <field name="breed_id"/>
  109. <field name="color_id"/>
  110. <field name="size"/>
  111. <separator/>
  112. <filter string="Female"
  113. domain="[('gender', '=', 'female')]"
  114. name="female"/>
  115. <filter string="Male"
  116. domain="[('gender', '=', 'male')]"
  117. name="male"/>
  118. <filter string="Hermaphrodite"
  119. domain="[('gender', '=', 'hermaphrodite')]"
  120. name="hermaphrodite"/>
  121. <filter string="Neutered"
  122. domain="[('gender', '=', 'neutered')]"
  123. name="neutered"/>
  124. <separator/>
  125. <group expand="0" string="Group By">
  126. <filter name="gender" string="Gender" domain=""
  127. context="{'group_by': 'gender'}"/>
  128. <filter name="species_id" string="Species" domain=""
  129. context="{'group_by': 'species_id'}"/>
  130. <filter name="breed_id" string="Breed" domain=""
  131. context="{'group_by': 'breed_id'}"/>
  132. <filter name="color_id" string="Color" domain=""
  133. context="{'group_by': 'color_id'}"/>
  134. </group>
  135. </search>
  136. </field>
  137. </record>
  138. <record id="action_animal" model="ir.actions.act_window">
  139. <field name="name">Animals</field>
  140. <field name="res_model">animal</field>
  141. <field name="view_type">form</field>
  142. <field name="view_mode">kanban,tree,form</field>
  143. <field name="search_view_id" ref="view_animal_search"/>
  144. <field name="help" type="html">
  145. <p class="o_view_nocontent_smiling_face">
  146. Create an animal.
  147. </p>
  148. </field>
  149. </record>
  150. </odoo>