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.

153 lines
6.8 KiB

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