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.

136 lines
7.0 KiB

  1. <odoo>
  2. <record id="product_template_share_form_view" model="ir.ui.view">
  3. <field name="name">product.template.share.form</field>
  4. <field name="model">product.template</field>
  5. <field name="inherit_id" ref="product.product_template_form_view"/>
  6. <field name="arch" type="xml">
  7. <xpath expr="//field[@name='purchase_ok']/.." position="after">
  8. <div groups="easy_my_coop.group_easy_my_coop_super_manager">
  9. <field name="is_share"/>
  10. <label for="is_share"/>
  11. </div>
  12. <div attrs="{'invisible':[('is_share','=',False)]}" groups="easy_my_coop.group_easy_my_coop_user">
  13. <field name="display_on_website"/>
  14. <label for="display_on_website"/>
  15. </div>
  16. </xpath>
  17. <xpath expr="//field[@name='type']" position="after">
  18. <field name="short_name" attrs="{'invisible':[('is_share','=',False)]}" groups="easy_my_coop.group_easy_my_coop_user"/>
  19. <field name="default_share_product" attrs="{'invisible':[('is_share','=',False)]}" groups="easy_my_coop.group_easy_my_coop_user"/>
  20. <field name="force_min_qty" attrs="{'invisible':[('is_share','=',False)]}" groups="easy_my_coop.group_easy_my_coop_user"/>
  21. <field name="minimum_quantity" attrs="{'invisible':[('is_share','=',False)]}" groups="easy_my_coop.group_easy_my_coop_user"/>
  22. <field name="customer" attrs="{'invisible':[('is_share','=',False)]}"/>
  23. <field name="by_company" attrs="{'invisible':[('is_share','=',False)]}" groups="easy_my_coop.group_easy_my_coop_user"/>
  24. <field name="by_individual" attrs="{'invisible':[('is_share','=',False)]}" groups="easy_my_coop.group_easy_my_coop_user"/>
  25. <field name="mail_template" attrs="{'invisible':[('is_share','=',False)]}" groups="easy_my_coop.group_easy_my_coop_user"/>
  26. </xpath>
  27. </field>
  28. </record>
  29. <record id="share_product_action" model="ir.actions.act_window">
  30. <field name="name">Share type</field>
  31. <field name="type">ir.actions.act_window</field>
  32. <field name="res_model">product.template</field>
  33. <field name="view_type">form</field>
  34. <field name="view_mode">kanban,tree,form</field>
  35. <!-- <field name="context">{"search_default_filter_to_purchase":1}</field> -->
  36. <field name="search_view_id" eval="False" /> <!-- Force empty -->
  37. <field name="view_id" eval="False" /> <!-- Force empty -->
  38. <field name="domain">[('is_share','=',True)]</field>
  39. <field name="help" type="html">
  40. <p class="oe_view_nocontent_create">
  41. Click to define a new share product.
  42. </p>
  43. </field>
  44. </record>
  45. <menuitem action="share_product_action" name="Share type" id="menu_easy_my_coop_share_product" parent="menu_easy_my_coop_main_subscription" sequence="20"/>
  46. <!-- overriding product views to not display share product in the purchase and sale views-->
  47. <record id="product.product_normal_action" model="ir.actions.act_window">
  48. <field name="name">Product</field>
  49. <field name="type">ir.actions.act_window</field>
  50. <field name="res_model">product.product</field>
  51. <field name="view_mode">tree,form,kanban</field>
  52. <field name="view_type">form</field>
  53. <field name="search_view_id" ref="product.product_search_form_view"/>
  54. <field name="view_id" eval="False"/> <!-- Force empty -->
  55. <field name="domain">[('is_share','=',False)]</field>
  56. <field name="help" type="html">
  57. <p class="oe_view_nocontent_create">
  58. Click to define a new product.
  59. </p><p>
  60. You must define a product for everything you sell, whether it's
  61. a physical product, a consumable or a service you offer to
  62. customers.
  63. </p><p>
  64. The product form contains information to simplify the sale
  65. process: price, notes in the quotation, accounting data,
  66. procurement methods, etc.
  67. </p>
  68. </field>
  69. </record>
  70. <record id="product.product_template_action" model="ir.actions.act_window">
  71. <field name="name">Products</field>
  72. <field name="type">ir.actions.act_window</field>
  73. <field name="res_model">product.template</field>
  74. <field name="view_mode">tree,form,kanban</field>
  75. <field name="view_type">form</field>
  76. <field name="view_id" ref="product.product_template_kanban_view"/>
  77. <field name="context">{"search_default_filter_to_sell":1}</field>
  78. <field name="domain">[('is_share','=',False)]</field>
  79. <field name="help" type="html">
  80. <p class="oe_view_nocontent_create">
  81. Click to define a new product.
  82. </p><p>
  83. You must define a product for everything you sell, whether it's a physical product, a consumable or a service you offer to customers.
  84. </p><p>
  85. The product form contains information to simplify the sale process: price, notes in the quotation, accounting data, procurement methods, etc.
  86. </p>
  87. </field>
  88. </record>
  89. <record id="product.product_template_action" model="ir.actions.act_window">
  90. <field name="name">Products</field>
  91. <field name="type">ir.actions.act_window</field>
  92. <field name="res_model">product.template</field>
  93. <field name="view_mode">tree,form,kanban</field>
  94. <field name="view_type">form</field>
  95. <field name="context">{"search_default_products": 1, 'default_type': 'product'}</field>
  96. <field name="domain">[('is_share','=',False)]</field>
  97. <field name="help" type="html">
  98. <p class="oe_view_nocontent_create">
  99. Click to define a new product.
  100. </p>
  101. </field>
  102. </record>
  103. <!-- move this action to another module cause the original action has been
  104. moved to purchase module. So we want to avoid make purchase module installed
  105. <record id="product.product_normal_action_puchased" model="ir.actions.act_window">
  106. <field name="name">Products</field>
  107. <field name="type">ir.actions.act_window</field>
  108. <field name="res_model">product.template</field>
  109. <field name="view_type">form</field>
  110. <field name="view_mode">kanban,tree,form</field>
  111. <field name="context">{"search_default_filter_to_purchase":1}</field>
  112. <field name="search_view_id" eval="False"/> Force empty
  113. <field name="view_id" eval="False"/> Force empty
  114. <field name="domain">[('is_share','=',False)]</field>
  115. <field name="help" type="html">
  116. <p class="oe_view_nocontent_create">
  117. Click to define a new product.
  118. </p><p>
  119. You must define a product for everything you purchase, whether
  120. it's a physical product, a consumable or services you buy to
  121. subcontractants.
  122. </p><p>
  123. The product form contains detailed information to improve the
  124. purchase process: prices, procurement logistics, accounting data,
  125. available vendors, etc.
  126. </p>
  127. </field>
  128. </record> -->
  129. </odoo>