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.

168 lines
7.6 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
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <odoo>
  3. <record id="product_template_share_form_view" model="ir.ui.view">
  4. <field name="name">product.template.share.form</field>
  5. <field name="model">product.template</field>
  6. <field name="inherit_id" ref="product.product_template_form_view"/>
  7. <field name="arch" type="xml">
  8. <xpath expr="//field[@name='purchase_ok']/.." position="after">
  9. <div groups="easy_my_coop.group_easy_my_coop_manager">
  10. <field name="is_share"/>
  11. <label for="is_share"/>
  12. </div>
  13. <div attrs="{'invisible':[('is_share','=',False)]}"
  14. groups="easy_my_coop.group_easy_my_coop_user">
  15. <field name="display_on_website"/>
  16. <label for="display_on_website"/>
  17. </div>
  18. </xpath>
  19. <page name="general_information" position="after">
  20. <page string="Share Information" name="share_information"
  21. attrs="{'invisible':[('is_share','=',False)]}"
  22. groups="easy_my_coop.group_easy_my_coop_user">
  23. <group>
  24. <group name="Info" string="Info">
  25. <field name="short_name"/>
  26. <field name="default_share_product"/>
  27. <field name="mail_template"/>
  28. </group>
  29. <group name="configuration" string="Configuration">
  30. <field name="force_min_qty"/>
  31. <field name="minimum_quantity"/>
  32. <field name="customer"
  33. attrs="{'invisible':[('is_share','=',False)]}"/>
  34. <field name="by_company"/>
  35. <field name="by_individual"/>
  36. </group>
  37. </group>
  38. </page>
  39. </page>
  40. </field>
  41. </record>
  42. <record id="share_product_filter" model="ir.ui.view">
  43. <field name="name">product.template.share.filter</field>
  44. <field name="model">product.template</field>
  45. <field name="inherit_id" ref="product.product_template_search_view"/>
  46. <field name="arch" type="xml">
  47. <xpath expr="." position="inside">
  48. <group expand="0" name="group_by" string="Group By">
  49. <filter name="Creation Date"
  50. context="{'group_by': 'create_date'}"/>
  51. </group>
  52. </xpath>
  53. </field>
  54. </record>
  55. <record id="product_template_only_form_view" model="ir.ui.view">
  56. <field name="name">product.template.product.form</field>
  57. <field name="model">product.template</field>
  58. <field name="inherit_id" ref="product.product_template_only_form_view"/>
  59. <field name="arch" type="xml">
  60. <field name="default_code" position="attributes">
  61. <attribute name="attrs">{'required': [('is_share', '=',
  62. True)]}
  63. </attribute>
  64. </field>
  65. </field>
  66. </record>
  67. <record id="share_product_action" model="ir.actions.act_window">
  68. <field name="name">Share type</field>
  69. <field name="type">ir.actions.act_window</field>
  70. <field name="res_model">product.template</field>
  71. <field name="view_type">form</field>
  72. <field name="view_mode">kanban,tree,form</field>
  73. <!-- <field name="context">{"search_default_filter_to_purchase":1}</field> -->
  74. <field name="search_view_id" eval="False"/> <!-- Force empty -->
  75. <field name="view_id" eval="False"/> <!-- Force empty -->
  76. <field name="domain">[('is_share','=',True)]</field>
  77. <field name="help" type="html">
  78. <p class="oe_view_nocontent_create">
  79. Click to define a new share product.
  80. </p>
  81. </field>
  82. </record>
  83. <!-- overriding product views to not display share product in the purchase and sale views-->
  84. <record id="product.product_normal_action" model="ir.actions.act_window">
  85. <field name="name">Product</field>
  86. <field name="type">ir.actions.act_window</field>
  87. <field name="res_model">product.product</field>
  88. <field name="view_mode">tree,form,kanban</field>
  89. <field name="view_type">form</field>
  90. <field name="search_view_id" ref="product.product_search_form_view"/>
  91. <field name="view_id" eval="False"/> <!-- Force empty -->
  92. <field name="domain">[('is_share','=',False)]</field>
  93. <field name="help" type="html">
  94. <p class="oe_view_nocontent_create">
  95. Click to define a new product.
  96. </p>
  97. <p>
  98. You must define a product for everything you sell, whether it's
  99. a physical product, a consumable or a service you offer to
  100. customers.
  101. </p>
  102. <p>
  103. The product form contains information to simplify the sale
  104. process: price, notes in the quotation, accounting data,
  105. procurement methods, etc.
  106. </p>
  107. </field>
  108. </record>
  109. <record id="product.product_template_action" model="ir.actions.act_window">
  110. <field name="name">Products</field>
  111. <field name="type">ir.actions.act_window</field>
  112. <field name="res_model">product.template</field>
  113. <field name="view_mode">tree,form,kanban</field>
  114. <field name="view_type">form</field>
  115. <field name="view_id" ref="product.product_template_kanban_view"/>
  116. <field name="context">{"search_default_filter_to_sell":1}</field>
  117. <field name="domain">[('is_share','=',False)]</field>
  118. <field name="help" type="html">
  119. <p class="oe_view_nocontent_create">
  120. Click to define a new product.
  121. </p>
  122. <p>
  123. You must define a product for everything you sell, whether it's
  124. a physical product, a consumable or a service you offer to
  125. customers.
  126. </p>
  127. <p>
  128. The product form contains information to simplify the sale
  129. process: price, notes in the quotation, accounting data,
  130. procurement methods, etc.
  131. </p>
  132. </field>
  133. </record>
  134. <!-- move this action to another module cause the original action has been
  135. moved to purchase module. So we want to avoid make purchase module installed
  136. <record id="product.product_normal_action_puchased" model="ir.actions.act_window">
  137. <field name="name">Products</field>
  138. <field name="type">ir.actions.act_window</field>
  139. <field name="res_model">product.template</field>
  140. <field name="view_type">form</field>
  141. <field name="view_mode">kanban,tree,form</field>
  142. <field name="context">{"search_default_filter_to_purchase":1}</field>
  143. <field name="search_view_id" eval="False"/> Force empty
  144. <field name="view_id" eval="False"/> Force empty
  145. <field name="domain">[('is_share','=',False)]</field>
  146. <field name="help" type="html">
  147. <p class="oe_view_nocontent_create">
  148. Click to define a new product.
  149. </p><p>
  150. You must define a product for everything you purchase, whether
  151. it's a physical product, a consumable or services you buy to
  152. subcontractants.
  153. </p><p>
  154. The product form contains detailed information to improve the
  155. purchase process: prices, procurement logistics, accounting data,
  156. available vendors, etc.
  157. </p>
  158. </field>
  159. </record> -->
  160. </odoo>