194 lines
9.5 KiB
XML
194 lines
9.5 KiB
XML
<?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">
|
|
<field name="categ_id" position="after">
|
|
<field string="POS Product Category" name="pos_categ_ids" filter_domain="[('pos_categ_ids', 'child_of', raw_value)]"/>
|
|
</field>
|
|
<filter name="filter_to_sell" position="before">
|
|
<filter name="filter_to_availabe_pos" string="Available in POS" domain="[('available_in_pos', '=', True)]"/>
|
|
</filter>
|
|
<filter name="categ_id" position="after">
|
|
<filter string="POS Product Category" name="pos_categ_ids" context="{'group_by':'pos_categ_ids'}"/>
|
|
</filter>
|
|
</field>
|
|
</record>
|
|
|
|
<record id="product_template_action_pos_product" model="ir.actions.act_window">
|
|
<field name="name">Products</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, 'create_variant_never': 'no_variant'}"/>
|
|
</record>
|
|
<record id="product_product_action" model="ir.actions.act_window">
|
|
<field name="name">Product Variants</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="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_only_form_view" model="ir.ui.view">
|
|
<field name="name">product.template.only.form.inherit</field>
|
|
<field name="model">product.template</field>
|
|
<field name="inherit_id" ref="product.product_template_only_form_view"/>
|
|
<field name="arch" type="xml">
|
|
<xpath expr="//field[@name='attribute_line_ids']//field[@name='attribute_id']" position="attributes">
|
|
<attribute name="context">{'default_create_variant': context.get('create_variant_never', 'always')}</attribute>
|
|
</xpath>
|
|
</field>
|
|
</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" remove="1" separator=" or "></attribute>
|
|
</xpath>
|
|
<xpath expr="//page[@name='sales']/group[@name='sale']" position="inside">
|
|
<group name="pos" string="Point of Sale" invisible="not sale_ok">
|
|
<field name="available_in_pos"/>
|
|
<field name="to_weight" invisible="not available_in_pos"/>
|
|
<field name="pos_categ_ids" widget="many2many_tags" groups="point_of_sale.group_pos_user" invisible="not available_in_pos" string="Category"/>
|
|
</group>
|
|
</xpath>
|
|
<xpath expr="//page[@name='general_information']" position="after">
|
|
<page name="combos" string="Combo Choices" groups="point_of_sale.group_pos_user" invisible="not detailed_type == 'combo'">
|
|
<field name="combo_ids" widget="one2many" >
|
|
<tree string="combos">
|
|
<field name="sequence" widget="handle"/>
|
|
<field name="name" />
|
|
<field name="base_price" />
|
|
<field name="num_of_products"/>
|
|
</tree>
|
|
</field>
|
|
</page>
|
|
</xpath>
|
|
<xpath expr="//page[@name='purchase']" position="attributes">
|
|
<attribute name="invisible" separator=" or " add="detailed_type == 'combo'"></attribute>
|
|
</xpath>
|
|
<xpath expr="//page[@name='inventory']" position="attributes">
|
|
<attribute name="invisible">type in ['combo', 'service']</attribute>
|
|
</xpath>
|
|
</field>
|
|
</record>
|
|
|
|
<!-- Hide variants page -->
|
|
<record id="product_template_only_form_view" model="ir.ui.view">
|
|
<field name="name">product.template.product.form.inherit</field>
|
|
<field name="model">product.template</field>
|
|
<field name="inherit_id" ref="product.product_template_only_form_view"/>
|
|
<field name="arch" type="xml">
|
|
<xpath expr="//page[@name='variants']" position="attributes">
|
|
<attribute name="invisible">detailed_type == "combo"</attribute>
|
|
</xpath>
|
|
</field>
|
|
</record>
|
|
|
|
<!-- Hide the Customer Taxes field -->
|
|
<record id="account_product_template_form_view" model="ir.ui.view">
|
|
<field name="name">product.template.product.form.account.inherit</field>
|
|
<field name="model">product.template</field>
|
|
<field name="inherit_id" ref="account.product_template_form_view"/>
|
|
<field name="arch" type="xml">
|
|
<xpath expr="//field[@name='taxes_id']" position="attributes">
|
|
<attribute name="invisible">detailed_type == "combo"</attribute>
|
|
</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="point_of_sale.menu_pos_combo"
|
|
name="Product Combos"
|
|
parent="point_of_sale.pos_config_menu_catalog"
|
|
action="point_of_sale.action_pos_combo"
|
|
sequence="15" />
|
|
<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>
|
|
|
|
<record id="product_template_tree_view" model="ir.ui.view">
|
|
<field name="name">product.template.product.tree.inherit</field>
|
|
<field name="model">product.template</field>
|
|
<field name="inherit_id" ref="product.product_template_tree_view"/>
|
|
<field name="arch" type="xml">
|
|
<field name="categ_id" position="before">
|
|
<field name="pos_categ_ids" widget="many2many_tags" groups="point_of_sale.group_pos_user" optional="hide" string="POS Product Category"/>
|
|
</field>
|
|
<field name="pos_categ_ids" position="after">
|
|
<field name="available_in_pos" groups="point_of_sale.group_pos_user" optional="hide"/>
|
|
</field>
|
|
</field>
|
|
</record>
|
|
|
|
<record id="product_product_tree_view" model="ir.ui.view">
|
|
<field name="name">product.product.product.tree.inherit</field>
|
|
<field name="model">product.product</field>
|
|
<field name="inherit_id" ref="product.product_product_tree_view"/>
|
|
<field name="arch" type="xml">
|
|
<field name="categ_id" position="before">
|
|
<field name="pos_categ_ids" widget="many2many_tags" groups="point_of_sale.group_pos_user" optional="hide" string="POS Product Category"/>
|
|
</field>
|
|
</field>
|
|
</record>
|
|
</odoo>
|