<?xml version="1.0" encoding="utf-8"?>
<openerp>
    <data>
        <!--产品list-->
        <record id="product_template_tree_view" model="ir.ui.view">
            <field name="name">product.template.product.tree</field>
            <field name="model">product.template</field>
            <field name="inherit_id" ref="product.product_template_tree_view"/>
            <field name="arch" type="xml">
                <xpath expr="//field[@name='type']" position="before">
                    <field name="internal_type"/>
                </xpath>
            </field>
        </record>
        <!--产品Form-->
        <record id="product_template_form_view" model="ir.ui.view">
            <field name="name">product.template.common.form</field>
            <field name="model">product.template</field>
            <field name="inherit_id" ref="product.product_template_form_view"/>
            <field name="arch" type="xml">
                <xpath expr="//div[@name='options']" position="before">
                    <div>
                        <h4>
                            <label class="oe_edit_only" for="internal_type"/>
                            <field name="internal_type" options="{'no_create': True,'no_open': True}" required="1"/>
                        </h4>
                    </div>
                </xpath>
            </field>
        </record>
        <!-- search，继承product原视图 -->
        <record id="app_product_template_search_view" model="ir.ui.view">
            <field name="name">app.product.template.search</field>
            <field name="model">product.template</field>
            <field name="inherit_id" ref="product.product_template_search_view"/>
            <field name="arch" type="xml">
                <xpath expr="//field[@name='pricelist_id']" position="after">
                    <group expand="0" name="group_by" string="Group By">
                        <filter name="internal_type" string="Internal Type" domain="[]" context="{'group_by' : 'internal_type'}"/>
                    </group>
                </xpath>
            </field>
        </record>
        <!--改产品默认视图为tree-->
        <record id="product.product_template_action" 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">tree,kanban,form</field>
            <field name="view_type">form</field>
            <field name="view_id" ref="product.product_template_kanban_view"/>
            <field name="context">{"search_default_filter_to_sell":1}</field>
            <field name="help" type="html">
                <p class="oe_view_nocontent_create">
                    Click to define a new product.
                </p>
                <p>
                    You must define a product for everything you sell, whether it's a physical product, a consumable or a service you offer to customers.
                </p>
                <p>
                    The product form contains information to simplify the sale process: price, notes in the quotation, accounting data, procurement methods,
                    etc.
                </p>
            </field>
        </record>
    </data>
</openerp>
