summaryrefslogtreecommitdiff
path: root/addons/point_of_sale/views/product_view.xml
diff options
context:
space:
mode:
authorstephanchrst <stephanchrst@gmail.com>2022-05-10 21:51:50 +0700
committerstephanchrst <stephanchrst@gmail.com>2022-05-10 21:51:50 +0700
commit3751379f1e9a4c215fb6eb898b4ccc67659b9ace (patch)
treea44932296ef4a9b71d5f010906253d8c53727726 /addons/point_of_sale/views/product_view.xml
parent0a15094050bfde69a06d6eff798e9a8ddf2b8c21 (diff)
initial commit 2
Diffstat (limited to 'addons/point_of_sale/views/product_view.xml')
-rw-r--r--addons/point_of_sale/views/product_view.xml111
1 files changed, 111 insertions, 0 deletions
diff --git a/addons/point_of_sale/views/product_view.xml b/addons/point_of_sale/views/product_view.xml
new file mode 100644
index 00000000..39b5bbda
--- /dev/null
+++ b/addons/point_of_sale/views/product_view.xml
@@ -0,0 +1,111 @@
+<?xml version="1.0" encoding="utf-8"?>
+<odoo>
+ <record id="product_template_search_view_pos" model="ir.ui.view">
+ <field name="name">product.template.search.pos.form</field>
+ <field name="model">product.template</field>
+ <field name="inherit_id" ref="product.product_template_search_view"/>
+ <field name="arch" type="xml">
+ <filter name="filter_to_sell" position="before">
+ <filter name="filter_to_availabe_pos" string="Available in POS" domain="[('available_in_pos', '=', True)]"/>
+ </filter>
+ </field>
+ </record>
+
+ <record id="product_template_action_pos_product" model="ir.actions.act_window">
+ <field name="name">Products</field>
+ <field name="type">ir.actions.act_window</field>
+ <field name="res_model">product.template</field>
+ <field name="view_mode">kanban,tree,form,activity</field>
+ <field name="context" eval="{'search_default_filter_to_availabe_pos': 1, 'default_available_in_pos': True}"/>
+ </record>
+ <record id="product_product_action" model="ir.actions.act_window">
+ <field name="name">Product Variants</field>
+ <field name="type">ir.actions.act_window</field>
+ <field name="res_model">product.product</field>
+ <field name="view_mode">kanban,tree,form,activity</field>
+ <field name="context" eval="{'search_default_filter_to_availabe_pos': 1, 'default_available_in_pos': True}"/>
+ <field name="domain" eval="[]"/>
+ <field name="search_view_id" eval="False"/> <!-- Force empty -->
+ <field name="view_id" ref="product.product_product_tree_view"/>
+ <field name="help" type="html">
+ <p class="o_view_nocontent_smiling_face">
+ Create a new product variant
+ </p><p>
+ You must define a product for everything you sell through
+ the point of sale interface.
+ </p>
+ </field>
+ </record>
+ <record id="product_category_action" model="ir.actions.act_window">
+ <field name="name">Internal Categories</field>
+ <field name="type">ir.actions.act_window</field>
+ <field name="res_model">product.category</field>
+ <field name="search_view_id" ref="product.product_category_search_view"/>
+ <field name="view_id" ref="product.product_category_list_view"/>
+ </record>
+
+ <record id="product_template_form_view" model="ir.ui.view">
+ <field name="name">product.template.form.inherit</field>
+ <field name="model">product.template</field>
+ <field name="inherit_id" ref="product.product_template_form_view"/>
+ <field name="arch" type="xml">
+ <xpath expr="//page[@name='sales']" position="attributes">
+ <attribute name="invisible">0</attribute>
+ </xpath>
+ <xpath expr="//page[@name='sales']" position="after">
+ <page name="pos" string="Point of Sale" attrs="{'invisible': [('sale_ok','=',False)]}">
+ <group name="pos">
+ <group>
+ <field name="available_in_pos"/>
+ <field name="pos_categ_id" attrs="{'invisible': [('available_in_pos', '=', False)]}" string="Category"/>
+ <field name="to_weight" attrs="{'invisible': [('available_in_pos', '=', False)]}"/>
+ </group>
+ </group>
+ </page>
+ </xpath>
+ </field>
+ </record>
+
+ <!-- Product Catalog menus and sub menus -->
+ <menuitem id="pos_config_menu_catalog"
+ name="Products"
+ parent="point_of_sale.menu_point_root"/>
+ <menuitem id="menu_pos_products"
+ action="product_template_action_pos_product"
+ parent="point_of_sale.pos_config_menu_catalog"
+ sequence="5"/>
+ <menuitem id="pos_config_menu_action_product_product"
+ name="Product Variants"
+ parent="point_of_sale.pos_config_menu_catalog"
+ action="product_product_action"
+ groups="product.group_product_variant"
+ sequence="10"/>
+ <menuitem id="pos_config_menu_action_product_pricelist"
+ parent="point_of_sale.pos_config_menu_catalog"
+ action="product.product_pricelist_action2"
+ groups="product.group_product_pricelist"
+ sequence="20"/>
+
+ <record id="product_uom_categ_form_view" model="ir.ui.view">
+ <field name="name">uom.category.form.inherit</field>
+ <field name="model">uom.category</field>
+ <field name="inherit_id" ref="uom.product_uom_categ_form_view"/>
+ <field name="arch" type="xml">
+ <xpath expr="//field[@name='name']" position="after">
+ <field name="is_pos_groupable" groups="base.group_no_one"/>
+ </xpath>
+ </field>
+ </record>
+
+ <record id="product_uom_categ_tree_view" model="ir.ui.view">
+ <field name="name">uom.category.tree.inherit</field>
+ <field name="model">uom.category</field>
+ <field name="inherit_id" ref="uom.product_uom_categ_tree_view"/>
+ <field name="arch" type="xml">
+ <xpath expr="//field[@name='name']" position="after">
+ <field name="is_pos_groupable" groups="base.group_no_one"/>
+ </xpath>
+ </field>
+ </record>
+
+</odoo>