product_view.xml 6.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144
  1. <?xml version="1.0" encoding="utf-8"?>
  2. <odoo>
  3. <record id="product_template_search_view_pos" model="ir.ui.view">
  4. <field name="name">product.template.search.pos.form</field>
  5. <field name="model">product.template</field>
  6. <field name="inherit_id" ref="product.product_template_search_view"/>
  7. <field name="arch" type="xml">
  8. <filter name="filter_to_sell" position="before">
  9. <filter name="filter_to_availabe_pos" string="Available in POS" domain="[('available_in_pos', '=', True)]"/>
  10. </filter>
  11. <filter name="categ_id" position="after">
  12. <filter string="POS Product Category" name="pos_categ_id" context="{'group_by':'pos_categ_id'}"/>
  13. </filter>
  14. </field>
  15. </record>
  16. <record id="product_template_action_pos_product" model="ir.actions.act_window">
  17. <field name="name">Products</field>
  18. <field name="type">ir.actions.act_window</field>
  19. <field name="res_model">product.template</field>
  20. <field name="view_mode">kanban,tree,form,activity</field>
  21. <field name="context" eval="{'search_default_filter_to_availabe_pos': 1, 'default_available_in_pos': True, 'create_variant_never': 'no_variant'}"/>
  22. </record>
  23. <record id="product_product_action" model="ir.actions.act_window">
  24. <field name="name">Product Variants</field>
  25. <field name="type">ir.actions.act_window</field>
  26. <field name="res_model">product.product</field>
  27. <field name="view_mode">kanban,tree,form,activity</field>
  28. <field name="context" eval="{'search_default_filter_to_availabe_pos': 1, 'default_available_in_pos': True}"/>
  29. <field name="domain" eval="[]"/>
  30. <field name="search_view_id" eval="False"/> <!-- Force empty -->
  31. <field name="view_id" ref="product.product_product_tree_view"/>
  32. <field name="help" type="html">
  33. <p class="o_view_nocontent_smiling_face">
  34. Create a new product variant
  35. </p><p>
  36. You must define a product for everything you sell through
  37. the point of sale interface.
  38. </p>
  39. </field>
  40. </record>
  41. <record id="product_category_action" model="ir.actions.act_window">
  42. <field name="name">Internal Categories</field>
  43. <field name="type">ir.actions.act_window</field>
  44. <field name="res_model">product.category</field>
  45. <field name="search_view_id" ref="product.product_category_search_view"/>
  46. <field name="view_id" ref="product.product_category_list_view"/>
  47. </record>
  48. <record id="product_template_only_form_view" model="ir.ui.view">
  49. <field name="name">product.template.only.form.inherit</field>
  50. <field name="model">product.template</field>
  51. <field name="inherit_id" ref="product.product_template_only_form_view"/>
  52. <field name="arch" type="xml">
  53. <xpath expr="//field[@name='attribute_line_ids']//field[@name='attribute_id']" position="attributes">
  54. <attribute name="context">{'default_create_variant': context.get('create_variant_never', 'always')}</attribute>
  55. </xpath>
  56. </field>
  57. </record>
  58. <record id="product_template_form_view" model="ir.ui.view">
  59. <field name="name">product.template.form.inherit</field>
  60. <field name="model">product.template</field>
  61. <field name="inherit_id" ref="product.product_template_form_view"/>
  62. <field name="arch" type="xml">
  63. <xpath expr="//page[@name='sales']" position="attributes">
  64. <attribute name="invisible">0</attribute>
  65. </xpath>
  66. <xpath expr="//page[@name='sales']/group[@name='sale']" position="inside">
  67. <group name="pos" string="Point of Sale" attrs="{'invisible': [('sale_ok','=',False)]}">
  68. <field name="available_in_pos"/>
  69. <field name="to_weight" attrs="{'invisible': [('available_in_pos', '=', False)]}"/>
  70. <field name="pos_categ_id" attrs="{'invisible': [('available_in_pos', '=', False)]}" string="Category"/>
  71. </group>
  72. </xpath>
  73. </field>
  74. </record>
  75. <!-- Product Catalog menus and sub menus -->
  76. <menuitem id="pos_config_menu_catalog"
  77. name="Products"
  78. parent="point_of_sale.menu_point_root"/>
  79. <menuitem id="menu_pos_products"
  80. action="product_template_action_pos_product"
  81. parent="point_of_sale.pos_config_menu_catalog"
  82. sequence="5"/>
  83. <menuitem id="pos_config_menu_action_product_product"
  84. name="Product Variants"
  85. parent="point_of_sale.pos_config_menu_catalog"
  86. action="product_product_action"
  87. groups="product.group_product_variant"
  88. sequence="10"/>
  89. <menuitem id="pos_config_menu_action_product_pricelist"
  90. parent="point_of_sale.pos_config_menu_catalog"
  91. action="product.product_pricelist_action2"
  92. groups="product.group_product_pricelist"
  93. sequence="20"/>
  94. <record id="product_uom_categ_form_view" model="ir.ui.view">
  95. <field name="name">uom.category.form.inherit</field>
  96. <field name="model">uom.category</field>
  97. <field name="inherit_id" ref="uom.product_uom_categ_form_view"/>
  98. <field name="arch" type="xml">
  99. <xpath expr="//field[@name='name']" position="after">
  100. <field name="is_pos_groupable" groups="base.group_no_one"/>
  101. </xpath>
  102. </field>
  103. </record>
  104. <record id="product_uom_categ_tree_view" model="ir.ui.view">
  105. <field name="name">uom.category.tree.inherit</field>
  106. <field name="model">uom.category</field>
  107. <field name="inherit_id" ref="uom.product_uom_categ_tree_view"/>
  108. <field name="arch" type="xml">
  109. <xpath expr="//field[@name='name']" position="after">
  110. <field name="is_pos_groupable" groups="base.group_no_one"/>
  111. </xpath>
  112. </field>
  113. </record>
  114. <record id="product_template_tree_view" model="ir.ui.view">
  115. <field name="name">product.template.product.tree.inherit</field>
  116. <field name="model">product.template</field>
  117. <field name="inherit_id" ref="product.product_template_tree_view"/>
  118. <field name="arch" type="xml">
  119. <field name="categ_id" position="before">
  120. <field name="pos_categ_id" optional="hide" string="POS Product Category"/>
  121. </field>
  122. </field>
  123. </record>
  124. <record id="product_product_tree_view" model="ir.ui.view">
  125. <field name="name">product.product.product.tree.inherit</field>
  126. <field name="model">product.product</field>
  127. <field name="inherit_id" ref="product.product_product_tree_view"/>
  128. <field name="arch" type="xml">
  129. <field name="categ_id" position="before">
  130. <field name="pos_categ_id" optional="hide" string="POS Product Category"/>
  131. </field>
  132. </field>
  133. </record>
  134. </odoo>