<?xml version="1.0" encoding="utf-8"?>
<openerp>
    <data>
        <menuitem id="base.menu_product" name="Product Variants" parent="base.menu_base_partner" sequence="9"/>

        <!-- templates -->

        <record id="product_template_search_view" model="ir.ui.view">
            <field name="name">product.template.search</field>
            <field name="model">product.template</field>
            <field name="arch" type="xml">
                <search string="Product">
                    <field name="name" string="Product" filter_domain="['|',('default_code','ilike',self),('name','ilike',self)]"/>
                    <filter string="Services" icon="terp-accessories-archiver" domain="[('type','=','service')]"/>
                    <filter string="Consumable" name="consumable" icon="terp-accessories-archiver" domain="[('type','=','consu')]" help="Consumable products"/>
                    <separator/>
                    <filter string="Can be Sold" name="filter_to_sell" icon="terp-accessories-archiver-minus" domain="[('sale_ok','=',1)]"/>
                    <field name="categ_id" filter_domain="[('categ_id', 'child_of', self)]"/>
                    <field string="Product Variant" name="product_variant_ids" filter_domain="['|', ('product_variant_ids.name','ilike',self), ('product_variant_ids.attribute_value_ids.attribute_id.name','ilike',self)]"/>
                    <field name="company_id"/>
                    <field name="pricelist_id" widget="selection" context="{'pricelist': self}" filter_domain="[]" groups="product.group_sale_pricelist"/> <!-- Keep widget=selection on this field to pass numeric `self` value, which is not the case for regular m2o widgets! -->
                    <group  expand='0' string='Group by...'>
                       <filter string='Category' domain="[]" context="{'group_by' : 'categ_id'}"/>
                       <filter string='Default Unit of Measure' icon="terp-mrp" domain="[]" context="{'group_by' : 'uom_id'}"/>
                       <filter string='Type' icon="terp-stock_symbol-selection" domain="[]" context="{'group_by' : 'type'}"/>
                    </group>
                </search>
            </field>
        </record>

        <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="arch" type="xml">
                <tree string="Product">
                    <field name="name"/>
                    <field name="categ_id"/>
                    <field name="type"/>
                    <field name="state"/>
                    <field name="uom_id" invisible="1"/>
                </tree>
            </field>
        </record>

        <!-- base structure of product.template, common with product.product -->
        <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="mode">primary</field>
            <field name="arch" type="xml">
                <form string="Product">
                    <field name="is_product_variant" invisible="1"/>
                    <field name='product_variant_count' invisible='1'/>
                    <sheet>
                        <field name="id" invisible="True"/>
                        <div class="oe_right oe_button_box" style="width: 300px;" name="buttons">
                        </div>
                        <div class="oe_left" style="width: 500px;">
                            <field name="image_medium" widget="image" class="oe_avatar oe_left"/>
                            <div class="oe_title" style="width: 390px;">
                                <label class="oe_edit_only" for="name" string="Product Name"/>
                                <h1><field name="name" class="oe_inline"/></h1>
                            </div>
                            <div class="oe_left" name="options" groups="base.group_user">
                                <div>
                                    <field name="sale_ok"/>
                                    <label for="sale_ok"/>
                                </div>
                            </div>
                        </div>
                        <notebook>
                            <page string="Information">
                                <group colspan="4">
                                    <group>
                                        <field name="type" on_change="onchange_type(type)"/>
                                        <field name="uom_id" on_change="onchange_uom(uom_id,uom_po_id)" groups="product.group_uom"/>
                                        <field name="list_price"/>
                                    </group>
                                    <group>
                                        <field name="active"/>
                                    </group>
                                </group>
                                <group colspan="4">
                                    <field name="company_id" groups="base.group_multi_company" widget="selection"/>
                                </group>
                                <field name="description" placeholder="describe the product characteristics..."/>
                            </page>
                            <page string="Procurements" groups="base.group_user">
                                <group name="procurement">
                                    <group name="general">
                                        <field name="standard_price"/>
                                    </group>
                                    <group name="procurement_uom" groups="product.group_uom" string="Purchase">
                                        <field name="uom_po_id"/>
                                    </group>
                                </group>
                                <separator string="Suppliers"/>
                                <field name="seller_ids"/>
                                <separator string="Description for Suppliers"/>
                                <field name="description_purchase" placeholder="This note will be displayed on requests for quotation..."/>
                            </page>
                            <page string="Inventory">
                                <group name="inventory">
                                     <group name="status" string="Status">
                                        <field name="state"/>
                                        <field name="product_manager"/>
                                    </group>
                                    <group name="weight" string="Weights" attrs="{'invisible':[('type','=','service')]}">
                                        <field digits="(14, 3)" name="volume"/>
                                        <field name="weight"/>
                                        <field name="weight_net"/>
                                    </group>
                                </group>
                                <group name="packaging" string="Packaging" attrs="{'invisible':[('type','=','service')]}" groups="product.group_stock_packaging" colspan="4">
                                    <field name="packaging_ids" string="Configurations" context="{'tree_view_ref':'product.product_packaging_tree_view_product', 'form_view_ref': 'product.product_packaging_form_view_without_product'}"/>
                                </group>
                            </page>
                            <page string="Sales" attrs="{'invisible':[('sale_ok','=',False)]}" name="sales">
                                <group name="sale">
                                    <group name="sale_condition" string="Sale Conditions" colspan="3">
                                        <label for="warranty"/>
                                        <div>
                                            <field name="warranty" class="oe_inline"/> months
                                        </div>
                                    </group>
                                    <group groups="product.group_uos" string="Unit of Measure">
                                        <field name="uos_id"/>
                                        <field name="uos_coeff"/>
                                        <field name="mes_type"/>
                                    </group>
                                </group>
                                <group name="website_and_pos" col="2">
                                </group>
                                <separator string="Description for Quotations"/>
                                <field name="description_sale" placeholder="note to be displayed on quotations..."/>
                            </page>
                        </notebook>
                    </sheet>
                    <div class="oe_chatter">
                        <field name="message_follower_ids" widget="mail_followers"/>
                        <field name="message_ids" widget="mail_thread"/>
                    </div>
                </form>
            </field>
        </record>

        <record id="product_search_form_view" model="ir.ui.view">
            <field name="name">product.product.search</field>
            <field name="model">product.product</field>
            <field name="mode">primary</field>
            <field name="inherit_id" ref="product.product_template_search_view"/>
            <field name="arch" type="xml">
                <field name="product_variant_ids" position="replace">
                    <field name="attribute_value_ids"/>
                </field>
                <field name="name" position="after">
                   <field name="product_tmpl_id" string="Product Template"/>
                </field>
                <xpath expr="//group[@string='Group by...']" position="inside">
                    <filter string='Product Template' name="template_id" domain="[]" context="{'group_by' : 'product_tmpl_id'}"/>
                </xpath>
            </field>
        </record>

        <!-- variants -->

        <record id="variants_template_tree_view" model="ir.ui.view">
            <field name="name">variants.template.tree</field>
            <field name="model">product.attribute.value</field>
            <field name="arch" type="xml">
                <tree string="Variant Values" editable="top">
                    <field name="sequence" widget="handle"/>
                    <field name="attribute_id"/>
                    <field name="name"/>
                    <field name="price_extra"/>
                </tree>
            </field>
        </record>
        <record id="variants_template_action" model="ir.actions.act_window">
            <field name="name">Variant Values</field>
            <field name="type">ir.actions.act_window</field>
            <field name="res_model">product.attribute.value</field>
            <field name="view_mode">tree</field>
            <field name="view_type">form</field>
            <field name="view_id" ref="variants_template_tree_view"/>
            <field name="domain">[('product_ids.product_tmpl_id', '=', active_id)]</field>
            <field name="context">{'default_product_tmpl_id': active_id}</field>
        </record>

        <record id="product_normal_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">tree,form,kanban</field>
            <field name="view_type">form</field>
            <field name="search_view_id" ref="product_search_form_view"/>
            <field name="view_id" eval="False"/> <!-- Force empty -->
            <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 buy or sell,
                whether it's a physical product, a consumable or service.
              </p>
            </field>
        </record>
        <record id="product_variant_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">tree,form,kanban</field>
            <field name="view_type">form</field>
            <field name="context">{'search_default_product_tmpl_id': [active_id], 'default_product_tmpl_id': active_id}</field>
            <field name="search_view_id" ref="product_search_form_view"/>
            <field name="view_id" eval="False"/> <!-- Force empty -->
            <field name="domain" eval="False"/> <!-- Force empty -->
            <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 buy or sell,
                whether it's a physical product, a consumable or service.
              </p>
            </field>
        </record>


        <!-- view specific to product.template -->
        <record id="product_template_only_form_view" model="ir.ui.view">
            <field name="name">product.template.product.form</field>
            <field name="model">product.template</field>
            <field name="mode">primary</field>
            <field name="priority" eval="8" />
            <field name="inherit_id" ref="product.product_template_form_view"/>
            <field name="arch" type="xml">
                <xpath expr="//form" position="attributes">
                    <attribute name="name">Product Template</attribute>
                </xpath>
                <field name="active" position="after">
                    <field name="ean13" attrs="{'invisible': [('product_variant_count', '>', 1)]}"/>
                    <field name="default_code" attrs="{'invisible': [('product_variant_count', '>', 1)]}"/>
                </field>
                <xpath expr="//page[@string='Sales']" position="after">
                    <page name="variants" string="Variants">
                        <div class="oe_right">
                            <button class="oe_inline oe_stat_button" string="Variant Prices"  name="%(variants_template_action)d" type="action" icon="fa-strikethrough"/>
                            <button class="oe_inline oe_stat_button" name="%(product.product_variant_action)d" type="action" icon="fa-sitemap">
                                <field string="List of Variants" name="product_variant_count" widget="statinfo" />
                            </button>
                        </div>
                        <p class="oe_grey">
                            <strong>Warning</strong>: adding or deleting attributes
                            will delete and recreate existing variants and lead
                            to the loss of their possible customizations.
                        </p>
                        <field name="attribute_line_ids" widget="one2many_list" context="{'show_attribute': False}">
                            <tree string="Variants" editable="bottom">
                                <field name="attribute_id"/>
                                <field name="value_ids" widget="many2many_tags" options="{'no_create_edit': True}" domain="[('attribute_id', '=', attribute_id)]" context="{'default_attribute_id': attribute_id}"/>
                            </tree>
                        </field>
                    </page>
                </xpath>
            </field>
        </record>

        <record id="product_template_kanban_view" model="ir.ui.view">
            <field name="name">Product.template.product.kanban</field>
            <field name="model">product.template</field>
            <field name="arch" type="xml">
                <kanban>
                    <field name="image_small"/>
                    <field name="lst_price"/>
                    <field name="is_product_variant"/>
                    <field name="product_variant_count"/>
                    <field name="product_variant_ids"/>
                    <templates>
                        <t t-name="kanban-box">
                            <div class="oe_kanban_vignette oe_semantic_html_override">
                                <a type="open"><img t-att-src="kanban_image('product.template', 'image_small', record.id.value)" class="oe_kanban_image"/></a>
                                <div class="oe_kanban_details">
                                    <h4>
                                        <a type="open">
                                             <span t-if="record.default_code.value">
                                                 [<field name="default_code"/>]
                                              </span>
                                             <field name="name"/> 
                                        </a>
                                    </h4>
                                    <a name="%(product.product_variant_action)d" type="action">
                                        <t t-esc="record.product_variant_count.value"/> Variants
                                    </a>
                                    <div name="tags"/>
                                    <ul>
                                        <li>Price: <field name="lst_price"></field></li>
                                    </ul>
                                </div>
                            </div>
                        </t>
                    </templates>
                </kanban>
            </field>
        </record>

        <record id="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">kanban,tree,form</field>
            <field name="view_type">form</field>
            <field name="view_id" ref="product_template_kanban_view"/>
            <field name="context">{"search_default_filter_to_sell":1}</field>
        </record>

        <menuitem action="product_template_action"
            id="menu_product_template_action"
            parent="base.menu_product" sequence="1" />

        <!-- product product -->

        <menuitem id="prod_config_main" name="Product Categories &amp; Attributes" parent="base.menu_base_config" sequence="70" groups="base.group_no_one"/>

        <record id="product_product_tree_view" model="ir.ui.view">
            <field name="name">product.product.tree</field>
            <field name="model">product.product</field>
            <field eval="7" name="priority"/>
            <field name="arch" type="xml">

                <tree string="Product Variants">
                    <field name="default_code"/>
                    <field name="name"/>
                    <field name="attribute_value_ids" widget="many2many_tags"/>
                    <field name="lst_price"/>
                    <field name="price" invisible="not context.get('pricelist',False)"/>
                    <field name="uom_id"/>
                    <field name="ean13"/>
                    <field name="state" invisible="1"/>
                    <field name="product_tmpl_id" invisible="1"/>
                </tree>
            </field>
        </record>

        <record id="product_normal_form_view" model="ir.ui.view">
            <field name="name">product.product.form</field>
            <field name="model">product.product</field>
            <field name="mode">primary</field>
            <field eval="7" name="priority"/>
            <field name="inherit_id" ref="product.product_template_form_view"/>
            <field name="arch" type="xml">
                <form position="attributes">
                    <attribute name="string">Product Variant</attribute>
                </form>
                <field name="active" position="after">
                    <field name="ean13"/>
                    <field name="default_code"/>
                </field>
                <field name="list_price" position="attributes">
                   <attribute name="name">lst_price</attribute>
                </field>
                <field name="name" position="replace">
                    <field name="name" attrs="{'invisible': [('id', '!=', False)]}"/>
                    <field name="product_tmpl_id" class="oe_inline" readonly="1" attrs="{'invisible': [('id', '=', False)], 'required': [('id', '!=', False)]}"/>
                </field>
                <xpath expr="//div[@class='oe_title']" position="inside">
                    <field name="attribute_value_ids" widget="many2many_tags"/>
                </xpath>
            </field>
        </record>

        <record id="product_kanban_view" model="ir.ui.view">
            <field name="name">Product Kanban</field>
            <field name="model">product.product</field>
            <field name="arch" type="xml">
                <kanban>
                    <field name="image_small"/>
                    <field name="lst_price"/>
                    <templates>
                        <t t-name="kanban-box">
                            <div class="oe_kanban_vignette oe_semantic_html_override">
                                <a type="open"><img t-att-src="kanban_image('product.product', 'image_small', record.id.value)" class="oe_kanban_image"/></a>
                                <div class="oe_kanban_details">
                                    <h4>
                                        <a type="open">
                                            <field name="name"/>
                                            <field name="attribute_value_ids"/>
                                        </a>
                                    </h4>
                                    <div name="tags"/>
                                    <ul>
                                        <li>Price: <field name="lst_price"></field></li>
                                    </ul>
                                </div>
                            </div>
                        </t>
                    </templates>
                </kanban>
            </field>
        </record>

        <!--  -->

        <record id="attribute_tree_view" model="ir.ui.view">
            <field name="name">product.attribute.tree</field>
            <field name="model">product.attribute</field>
            <field name="arch" type="xml">
                <tree string="Variant Values" editable="top">
                    <field name="name"/>
                </tree>
            </field>
        </record>

        <record id="attribute_action" model="ir.actions.act_window">
            <field name="name">Attributes</field>
            <field name="type">ir.actions.act_window</field>
            <field name="res_model">product.attribute</field>
            <field name="view_mode">tree</field>
            <field name="view_type">form</field>
        </record>

        <menuitem action="attribute_action"
            id="menu_attribute_action"
            parent="product.prod_config_main" sequence="9" />

        <record id="variants_tree_view" model="ir.ui.view">
            <field name="name">product.attribute.value.tree</field>
            <field name="model">product.attribute.value</field>
            <field name="arch" type="xml">
                <tree string="Variant Values" editable="top">
                    <field name="sequence" widget="handle"/>
                    <field name="attribute_id"/>
                    <field name="name"/>
                </tree>
            </field>
        </record>

        <record id="variants_action" model="ir.actions.act_window">
            <field name="name">Attribute Values</field>
            <field name="type">ir.actions.act_window</field>
            <field name="res_model">product.attribute.value</field>
            <field name="view_mode">tree</field>
            <field name="view_type">form</field>
        </record>

        <menuitem action="variants_action"
            id="menu_variants_action"
            parent="product.prod_config_main" sequence="10" />

        <!--  -->

        <record id="product_normal_action_sell" 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</field>
            <field name="view_type">form</field>
            <field name="context">{"search_default_filter_to_sell":1}</field>
            <field name="view_id" ref="product_product_tree_view"/>
            <field name="search_view_id" ref="product_search_form_view"/>
            <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>

        <menuitem id="product.menu_products" action="product.product_normal_action_sell" parent="base.menu_product" groups="base.group_no_one" sequence="10"/>

        <record id="product_category_search_view" model="ir.ui.view">
            <field name="name">product.category.search</field>
            <field name="model">product.category</field>
            <field name="arch" type="xml">
                <search string="Product Categories">
                    <field name="name" string="Product Categories"/>
                    <field name="parent_id"/>
                </search>
            </field>
        </record>
        <record id="product_category_form_view" model="ir.ui.view">
            <field name="name">product.category.form</field>
            <field name="model">product.category</field>
            <field name="arch" type="xml">
                <form string="Product Categories">
                    <sheet>
                        <div class="oe_title">
                            <label for="name" class="oe_edit_only"/>
                            <h1>
                                <field name="name"/>
                            </h1>
                        </div>
                        <group>
                            <group name="parent" col="4">
                                <field name="parent_id"/>
                                <field name="type"/>
                            </group>
                        </group>
                    </sheet>
                </form>
            </field>
        </record>
        <record id="product_category_list_view" model="ir.ui.view">
            <field name="name">product.category.list</field>
            <field name="model">product.category</field>
            <field name="priority">1</field>
            <field name="arch" type="xml">
                <tree string="Product Categories">
                    <field name="complete_name"/>
                </tree>
            </field>
        </record>
        <record id="product_category_tree_view" model="ir.ui.view">
            <field name="name">product.category.tree</field>
            <field name="model">product.category</field>
            <field name="field_parent">child_id</field>
            <field name="arch" type="xml">
                <tree toolbar="True" string="Product Categories">
                    <field name="name"/>
                </tree>
            </field>
        </record>
        <record id="product_category_action" model="ir.actions.act_window">
            <field name="name">Products by Category</field>
            <field name="type">ir.actions.act_window</field>
            <field name="res_model">product.category</field>
            <field name="domain">[('parent_id','=',False)]</field>
            <field name="view_type">tree</field>
            <field name="view_id" ref="product_category_tree_view"/>
            <field name="help" type="html">
              <p>
                Here is a list of all your products classified by category. You
                can click a category to get the list of all products linked to
                this category or to a child of this category.
              </p>
            </field>
        </record>
        <menuitem
            action="product_category_action"
            id="product.menu_products_category"
            parent="base.menu_product"
            sequence="30" groups="base.group_no_one"/>
        <record id="product_category_action_form" model="ir.actions.act_window">
            <field name="name">Product Categories</field>
            <field name="type">ir.actions.act_window</field>
            <field name="res_model">product.category</field>
            <field name="view_type">form</field>
            <field name="search_view_id" ref="product_category_search_view"/>
            <field name="view_id" ref="product_category_list_view"/>
        </record>
        <menuitem action="product_category_action_form"
            groups="base.group_no_one"
            id="menu_product_category_action_form"
            parent="prod_config_main" sequence="2"/>


        <record id="product_normal_action_tree" 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_type">form</field>
            <field name="view_mode">tree,form,kanban</field>
            <field name="context">{'categ_id':active_id, 'search_default_categ_id':active_id}</field>
        </record>
        <record id="ir_product_category_open" model="ir.values">
            <field eval="'tree_but_open'" name="key2"/>
            <field eval="'product.category'" name="model"/>
            <field name="name">Products by Categories</field>
            <field eval="'ir.actions.act_window,%d'%product_normal_action_tree" name="value"/>
        </record>

        <!-- Unit of Measure -->

        <record id="product_uom_tree_view" model="ir.ui.view">
            <field name="name">product.uom.tree</field>
            <field name="model">product.uom</field>
            <field name="arch" type="xml">
                <tree string="Units of Measure">
                    <field name="name"/>
                    <field name="category_id"/>
                </tree>
            </field>
        </record>

        <record id="product_uom_form_view" model="ir.ui.view">
            <field name="name">product.uom.form</field>
            <field name="model">product.uom</field>
            <field name="arch" type="xml">
                <form string="Units of Measure">
                    <group>
                        <group>
                            <field name="name"/>
                            <field name="category_id"/>
                            <field name="uom_type" on_change="onchange_type(uom_type)"/>
                            <field name="factor"
                                digits="[42,5]"
                                attrs="{'invisible':[('uom_type','!=','smaller')],
                                        'readonly':[('uom_type','=','bigger')]}"/>
                            <field name="factor_inv"
                                digits="[42,5]"
                                attrs="{'invisible':[('uom_type','!=','bigger')],
                                        'readonly':[('uom_type','!=','bigger')]}"/>
                            <p attrs="{'invisible':[('uom_type','!=','smaller')]}" class="oe_grey" colspan="2">
                                e.g: 1 * (reference unit) = ratio * (this unit)
                            </p>
                            <p attrs="{'invisible':[('uom_type','!=','bigger')]}" class="oe_grey" colspan="2">
                                e.g: 1 * (this unit) = ratio * (reference unit)
                            </p>
                        </group>
                        <group>
                            <field name="active"/>
                            <field name="rounding" digits="[42, 5]"/>
                        </group>
                    </group>
                </form>
            </field>
        </record>
        <record id="product_uom_form_action" model="ir.actions.act_window">
            <field name="name">Units of Measure</field>
            <field name="type">ir.actions.act_window</field>
            <field name="res_model">product.uom</field>
            <field name="view_type">form</field>
            <field name="view_id" ref="product_uom_tree_view"/>
            <field name="help" type="html">
              <p class="oe_view_nocontent_create">
                Click to add a new unit of measure.
              </p><p>
                You must define a conversion rate between several Units of
                Measure within the same category.
              </p>
            </field>
        </record>
        <menuitem id="next_id_16" name="Units of Measure" parent="prod_config_main" sequence="30" groups="product.group_uom"/>
        <menuitem action="product_uom_form_action" id="menu_product_uom_form_action" parent="base.menu_base_config" sequence="30" groups="product.group_uom"/>

        <record id="product_uom_categ_form_view" model="ir.ui.view">
            <field name="name">product.uom.categ.form</field>
            <field name="model">product.uom.categ</field>
            <field name="arch" type="xml">
                <form string="Units of Measure categories">
                    <group>
                        <field name="name"/>
                    </group>
                </form>
            </field>
        </record>
        <record id="product_uom_categ_form_action" model="ir.actions.act_window">
            <field name="name">Unit of Measure Categories</field>
            <field name="type">ir.actions.act_window</field>
            <field name="res_model">product.uom.categ</field>
            <field name="view_type">form</field>
            <field name="view_mode">tree,form</field>
            <field name="help" type="html">
              <p class="oe_view_nocontent_create">
                Click to add a new unit of measure category.
              </p><p>
                Units of measure belonging to the same category can be
                converted between each others. For example, in the category
                <i>'Time'</i>, you will have the following units of measure:
                Hours, Days.
              </p>
            </field>
        </record>
        <menuitem action="product_uom_categ_form_action" id="menu_product_uom_categ_form_action" parent="base.menu_base_config" sequence="25" groups="base.group_no_one"/>

        <record id="product_ul_form_view" model="ir.ui.view">
            <field name="name">product.ul.form.view</field>
            <field name="model">product.ul</field>
            <field name="arch" type="xml">
                <form string="Logistic Units">
                    <sheet>
                    <group>
                        <field name="name"/>
                        <field name="type"/>
                    </group>
                    <group>
                        <field name="height"/>
                        <field name="width"/>
                        <field name="length"/>
                        <field name="weight"/>
                    </group>
                    </sheet>
                </form>
            </field>
        </record>
        <record id="product_ul_tree" model="ir.ui.view">
            <field name="name">product.ul.tree</field>
            <field name="model">product.ul</field>
            <field name="arch" type="xml">
                <tree string="Logistic Units">
                    <field name="name"/>
                    <field name="type"/>
                </tree>
            </field>
        </record>
        <record id="product_ul_form_action" model="ir.actions.act_window">
            <field name="name">Logistic Units</field>
            <field name="type">ir.actions.act_window</field>
            <field name="res_model">product.ul</field>
            <field name="view_type">form</field>
            <field name="view_mode">tree,form</field>
            <field name="help" type="html">
              <p class="oe_view_nocontent_create">
                Click to add a new Logistic Unit
              </p><p>
                The logistic unit defines the container used for the package.  
                It has a type (e.g. pallet, box, ...) and you can specify its 
                size. 
              </p>
            </field>
        </record>
        <menuitem
            action="product_ul_form_action" groups="product.group_stock_packaging" id="menu_product_ul_form_action" parent="prod_config_main" sequence="5"/>

        <record id="product_packaging_tree_view" model="ir.ui.view">
            <field name="name">product.packaging.tree.view</field>
            <field name="model">product.packaging</field>
            <field name="arch" type="xml">
                <tree string="Packaging">
                    <field name="sequence" widget="handle"/>
                    <field name="product_tmpl_id"/>
                    <field name="ean"/>
                    <field name="qty"/>
                    <field name="ul"/>
                    <field name="ul_container"/>
                </tree>
            </field>
        </record>

        <record id="product_packaging_tree_view_product" model="ir.ui.view">
            <field name="name">product.packaging.tree.view.product</field>
            <field name="model">product.packaging</field>
            <field name="arch" type="xml">
                <tree string="Packaging">
                    <field name="qty"/>
                    <field name="ul"/>
                    <field name="ul_qty"/>
                    <field name="rows"/>
                    <field name="ul_container"/>
                </tree>
            </field>
        </record>

        <record id="product_packaging_form_view" model="ir.ui.view">
            <field name="name">product.packaging.form.view</field>
            <field name="model">product.packaging</field>
            <field name="arch" type="xml">
                <form string="Packaging">
                    <group col="4">
                        <field name="product_tmpl_id"/>
                        <newline/>
                        <field name="ean"/>
                        <field name="sequence" invisible="1"/>
                        <newline/>
                        <field name="qty"/>
                        <field name="ul"/>
                        <separator colspan="4" string="Palletization"/>
                        <field name="ul_qty"/>
                        <field name="rows"/>
                        <field name="ul_container"/>
                        <field name="weight"/>
                        <separator colspan="4" string="Other Info"/>
                        <field colspan="4" name="name"/>
                    </group>
                </form>
            </field>
        </record>

        <record id="product_packaging_form_view_without_product" model="ir.ui.view">
            <field name="name">product.packaging.form.view.without.product</field>
            <field name="model">product.packaging</field>
            <field name="arch" type="xml">
                <form string="Packaging">
                    <group col="4">
                        <field name="ean"/>
                        <field name="sequence" invisible="1"/>
                        <newline/>
                        <field name="qty"/>
                        <field name="ul"/>
                        <separator colspan="4" string="Palletization"/>
                        <field name="ul_qty"/>
                        <field name="rows"/>
                        <field name="ul_container"/>
                        <field name="weight"/>
                        <separator colspan="4" string="Other Info"/>
                        <field colspan="4" name="name"/>
                    </group>
                </form>
            </field>
        </record>

        <record id="product_supplierinfo_form_view" model="ir.ui.view">
            <field name="name">product.supplierinfo.form.view</field>
            <field name="model">product.supplierinfo</field>
            <field name="arch" type="xml">
                <form string="Supplier Information">
                    <group col="4">
                        <field name="name" context="{'default_customer': 0, 'search_default_supplier': 1, 'default_supplier': 1}"/>
                        <field name="sequence"/>
                        <field name="product_name"/>
                        <field name="product_code"/>
                        <field name="min_qty"/>
                        <field name="product_uom" groups="product.group_uom"/>
                        <field name="delay"/>
                        <field name="company_id" groups="base.group_multi_company" widget="selection"/>
                    </group>
                    <p groups="product.group_purchase_pricelist" class="oe_grey">The prices below will only be taken into account when your pricelist is set as based on supplier prices.</p>
                    <field groups="product.group_purchase_pricelist" name="pricelist_ids">
                        <tree editable="bottom" string="Pricelist">
                            <field name="min_quantity"/>
                            <field name="price"/>
                        </tree>
                        <form>
                            <group>
                                <field name="min_quantity"/>
                                <field name="price"/>
                            </group>
                        </form>
                    </field>
                </form>
            </field>
        </record>
        <record id="product_supplierinfo_tree_view" model="ir.ui.view">
            <field name="name">product.supplierinfo.tree.view</field>
            <field name="model">product.supplierinfo</field>
            <field name="arch" type="xml">
                <tree string="Supplier Information">
                    <field name="sequence" widget="handle"/>
                    <field name="name"/>
                    <field name="delay"/>
                    <field name="min_qty"/>
                    <field name="company_id" groups="base.group_multi_company" widget="selection"/>
                </tree>
            </field>
        </record>

    </data>
</openerp>
