product_views.xml 7.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148
  1. <?xml version="1.0" encoding="utf-8"?>
  2. <odoo>
  3. <!-- MEMBERSHIP -->
  4. <!-- MEMBERSHIP/MEMBERSHIP PRODUCTS -->
  5. <record model="ir.ui.view" id="membership_product_search_form_view">
  6. <field name="name">membership.product.search.form</field>
  7. <field name="model">product.template</field>
  8. <field name="priority">50</field>
  9. <field name="arch" type="xml">
  10. <search string="Membership Products">
  11. <field name="name" string="Membership Product"/>
  12. <filter string="Inactive" name="inactive" domain="[('active','=',False)]"/>
  13. <field name="categ_id" operator="child_of"/>
  14. <group expand='0' string='Group by...'>
  15. <filter string='Category' name="category" domain="[]" context="{'group_by' : 'categ_id'}"/>
  16. <filter string='Start Date' name="from_month" domain="[]" context="{'group_by' : 'membership_date_from'}"/>
  17. </group>
  18. </search>
  19. </field>
  20. </record>
  21. <record model="ir.ui.view" id="membership_products_tree">
  22. <field name="name">Membership products</field>
  23. <field name="model">product.template</field>
  24. <field name="priority">50</field>
  25. <field name="arch" type="xml">
  26. <tree string="Membership products">
  27. <field name="name"/>
  28. <field name="membership_date_from"/>
  29. <field name="membership_date_to"/>
  30. <field name="list_price" string="Membership Fee"/>
  31. <field name="categ_id" invisible="1"/>
  32. <field name="uom_id" invisible="1"/>
  33. <field name="type" invisible="1"/>
  34. </tree>
  35. </field>
  36. </record>
  37. <record id="membership_products_kanban" model="ir.ui.view">
  38. <field name="name">product.template.kanban</field>
  39. <field name="model">product.template</field>
  40. <field name="arch" type="xml">
  41. <kanban class="o_kanban_mobile">
  42. <field name="name"/>
  43. <field name="membership_date_from"/>
  44. <field name="membership_date_to"/>
  45. <field name="list_price"/>
  46. <templates>
  47. <t t-name="kanban-box">
  48. <div t-attf-class="oe_kanban_card oe_kanban_global_click">
  49. <div class="o_kanban_record_top">
  50. <div class="o_kanban_record_headings">
  51. <strong class="o_kanban_record_title"><span class="mt4"><field name="name"/></span></strong>
  52. </div>
  53. <span class="badge rounded-pill"><i class="fa fa-money" role="img" aria-label="Price" title="Price"/> <field name="list_price"/></span>
  54. </div>
  55. <div class="o_kanban_record_body">
  56. <i class="fa fa-clock-o" role="img" aria-label="Period" title="Period"></i><strong> From: </strong><field name="membership_date_from"/><strong> To:</strong> <field name="membership_date_to"/>
  57. </div>
  58. </div>
  59. </t>
  60. </templates>
  61. </kanban>
  62. </field>
  63. </record>
  64. <record model="ir.ui.view" id="membership_products_form">
  65. <field name="name">Membership Products</field>
  66. <field name="model">product.template</field>
  67. <field name="priority">50</field>
  68. <field name="arch" type="xml">
  69. <form string="Membership products">
  70. <sheet>
  71. <label for="name" string="Product Name"/>
  72. <h1>
  73. <field name="name"/>
  74. </h1>
  75. <group>
  76. <group name="product_details">
  77. <field name="default_code"/>
  78. <field name="categ_id"/>
  79. <field name="membership" invisible="1"/>
  80. <field name="company_id"
  81. groups="base.group_multi_company"
  82. options="{'no_create': True}"/>
  83. <field name="active" widget="boolean_toggle"/>
  84. </group>
  85. <group name="membership_details">
  86. <label for="membership_date_from" string="Membership Duration"/>
  87. <div class="o_row">
  88. <field name="membership_date_from" required="1"/> -
  89. <field name="membership_date_to" required="1"/>
  90. </div>
  91. <field name="list_price" string="Membership Fee"/>
  92. <field
  93. name="property_account_income_id"/>
  94. <field name="taxes_id" widget="many2many_tags" string="Taxes"/>
  95. </group>
  96. </group>
  97. <label for="description"/>
  98. <field colspan="4" name="description" placeholder="Add a description..."/>
  99. <label for="description_sale"/>
  100. <field colspan="4" name="description_sale" placeholder="This note will be displayed on quotations..."/>
  101. </sheet>
  102. </form>
  103. </field>
  104. </record>
  105. <record model="ir.actions.act_window" id="action_membership_products">
  106. <field name="name">Membership Products</field>
  107. <field name="res_model">product.template</field>
  108. <field name="domain">[('membership','=',True), ('type', '=', 'service')]</field>
  109. <field name="context">{'membership':True, 'type':'service', 'default_membership': True, 'default_detailed_type': 'service'}</field>
  110. <field name="search_view_id" ref="membership_product_search_form_view"/>
  111. </record>
  112. <record model="ir.actions.act_window.view" id="action_membership_product_view_tree">
  113. <field name="sequence" eval="1"/>
  114. <field name="view_mode">tree</field>
  115. <field name="view_id" ref="membership_products_tree"/>
  116. <field name="act_window_id" ref="action_membership_products"/>
  117. </record>
  118. <record model="ir.actions.act_window.view" id="action_membership_product_view_form">
  119. <field name="sequence" eval="2"/>
  120. <field name="view_mode">form</field>
  121. <field name="view_id" ref="membership_products_form"/>
  122. <field name="act_window_id" ref="action_membership_products"/>
  123. </record>
  124. <record model="ir.actions.act_window.view" id="action_membership_product_view_kanban">
  125. <field name="sequence" eval="3"/>
  126. <field name="view_mode">kanban</field>
  127. <field name="view_id" ref="membership_products_kanban"/>
  128. <field name="act_window_id" ref="action_membership_products"/>
  129. </record>
  130. <menuitem name="Members" id="menu_association" sequence="15" web_icon="membership,static/description/icon.svg"/>
  131. <menuitem name="Configuration" id="menu_marketing_config_association"
  132. parent="menu_association" sequence="100"/>
  133. <menuitem name="Membership Products" id="menu_membership_products" parent="menu_marketing_config_association"
  134. action="action_membership_products"/>
  135. </odoo>