product_variant / product.xml

The default branch has multiple heads

<?xml version="1.0"?>
    <!--
        This file is part of Tryton. The COPYRIGHT file at the top level of
        this repository contains the full copyright notices and license terms.
    -->
<tryton>
    <data>
        <record model="ir.ui.view" id="product_view_form">
            <field name="model">product.product</field>
            <field name="inherit" ref="product.product_view_form"/>
            <field name="arch" type="xml">
                <![CDATA[
                <data>
                    <xpath
                        expr="/form/notebook/page[@id=&quot;general&quot;]/label[@name=&quot;code&quot;]"
                        position="before">
                        <label name="template"/>
                        <field name="template"/>
                        <label name="variant"/>
                        <field name="variant"/>
                    </xpath>
                   
                </data>
                ]]>
            </field>
        </record>

        <record model="ir.ui.view" id="product_view_tree">
            <field name="model">product.product</field>
            <field name="inherit" ref="product.product_view_tree"/>
            <field name="arch" type="xml">
                <![CDATA[
                <data>
                    <xpath
                        expr="/tree/field[@name=&quot;variant&quot;]"
                        position="replace"/>
                </data>
                ]]>
            </field>
        </record>

        <record model="ir.ui.view" id="template_view_form">
            <field name="model">product.template</field>
            <field name="inherit" ref="product.template_view_form"/>
            <field name="arch" type="xml">
                <![CDATA[
                <data>
                    <xpath expr="/form/field[@name=&quot;active&quot;]"
                        position="after">
                        <label name="basecode"/>
                        <field name="basecode"/>
                    </xpath>
                    <xpath expr="/form/notebook/page[@id=&quot;general&quot;]"
                        position="after">
                        <page id="attribute_values" string="Attribute Values"
                            states="{'invisible': 
                                Or(Not(Bool(Eval('attribute_values'))),
                                Not(Bool(Eval('variant'))))}">
                            <field name="attribute_values"/>
                        </page>
                    </xpath>
                    <xpath expr="/form/notebook/page[@id=&quot;general&quot;]"
                        position="after">
                        <page string="Basedescription" col="4" id="description"
                            states="{'invisible': Not(Bool(Eval('variant')))}">
                            <field name="basedescription" colspan="4"/>
                        </page>
                    </xpath>
                    <xpath expr="/form/notebook/page[@id=&quot;general&quot;]"
                        position="after">
                        <page string="Variants" col="4" id="products"
                            states="{'invisible': Bool(Eval('template'))}">
                            <field name="products" colspan="4"/>
                            <field name="attributes" colspan="4"/>
                            <button name="generate_variants" 
                                string="Generate Variants"
                                type="object" icon="tryton-ok"/>
                        </page>
                    </xpath>
                </data>
                ]]>
            </field>
        </record>

        <record model="ir.ui.view" id="template_view_tree">
            <field name="model">product.template</field>
            <field name="inherit" ref="product.template_view_tree"/>
            <field name="arch" type="xml">
                <![CDATA[
                <data>
                    <xpath
                        expr="/tree/field[@name=&quot;name&quot;]"
                        position="after">
                        <field name="variant"/>   
                    </xpath>
                </data>
                ]]>
            </field>
        </record>

        <record model="ir.action.act_window" id="act_template_form">
            <field name="name">Product Template</field>
            <field name="res_model">product.template</field>
            <field name="search_value">{'variant': ['=', True]}</field>
        </record>

        <record model="ir.action.act_window.view" id="act_template_list_view">
            <field name="sequence" eval="100"/>
            <field name="view" ref="template_view_tree"/>
            <field name="act_window" ref="act_template_form"/>
        </record>

        <record model="ir.action.act_window.view" id="act_template_form_view">
            <field name="sequence" eval="110"/>
            <field name="view" ref="template_view_form"/>
            <field name="act_window" ref="act_template_form"/>
        </record>

        <menuitem name="Templates" parent="product.menu_main_product"
            sequence="10" id="menu_product_template" action="act_template_form"/>

        <record model="ir.action.act_window" id="act_product_attribute_form">
            <field name="name">Product Attributes</field>
            <field name="res_model">product.attribute</field>
        </record>

        <record model="ir.ui.view" id="product_attribute_view_form">
            <field name="model">product.attribute</field>
            <field name="type">form</field>
            <field name="arch" type="xml">
                <![CDATA[
                <form string="Product Attributes">
                <label name="name"/>
                <field name="name"/>
                <label name="sequence"/>
                <field name="sequence"/>
                <newline/>
                <field name="values" colspan="4"/>
                </form>
                ]]>
            </field>
        </record>

        <record model="ir.ui.view" id="product_attribute_view_tree">
            <field name="model">product.attribute</field>
            <field name="type">tree</field>
            <field name="arch" type="xml">
                <![CDATA[
                <tree string="Product Attributes" sequence="sequence">
                <field name="sequence"/>
                <field name="name"/>
                <field name="values"/>
                </tree>
                ]]>
            </field>
        </record>

        <menuitem name="Product Attributes" id="menu_product_attribute"
            parent="menu_product_configuration" sequence="10"
            action="act_product_attribute_form" groups="product.group_product_admin"/>

        <record model="ir.ui.view" id="product_attribute_value_view_form">
            <field name="model">product.attribute.value</field>
            <field name="type">form</field>
            <field name="arch" type="xml">
                <![CDATA[
                <form string="Product Attribute Values">
                <label name="name"/>
                <field name="name"/>
                <label name="code"/>
                <field name="code"/>
                </form>
                ]]>
            </field>
        </record>
        
        <record model="ir.ui.view" id="product_attribute_value_view_tree">
            <field name="model">product.attribute.value</field>
            <field name="type">tree</field>
            <field name="arch" type="xml">
                <![CDATA[
                <tree string="Product Attribute Values" sequence="sequence">
                <field name="sequence" tree_invisible="1"/>
                <field name="name"/>
                <field name="code"/>
                </tree>
                ]]>
            </field>
        </record>
    </data>
</tryton>
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.