<?xml version="1.0"?>
<data><xpath expr="//form" position="attributes">
                <attribute name="name">Product Template</attribute>
            </xpath>
            <field name="categ_id" position="after">
                <field name="default_code" string="Reference" invisible="product_variant_count &gt; 1"/>
                <field name="valid_product_template_attribute_line_ids" invisible="1"/>
                <field name="barcode" invisible="product_variant_count &gt; 1                         or (product_variant_count == 0                         and valid_product_template_attribute_line_ids)                         or type in ['service', 'combo']"/>
            </field>

            <button name="action_open_documents" position="before">
                <button name="217" type="action" icon="fa-sitemap" class="oe_stat_button" invisible="product_variant_count &lt;= 1" groups="product.group_product_variant">
                    <field string="Variants" name="product_variant_count" widget="statinfo"/>
                </button>
            </button>

            <xpath expr="//page[@name='general_information']" position="after">
                <page name="variants" string="Attributes &amp; Variants" groups="product.group_product_variant" invisible="type == 'combo'">
                    <field name="attribute_line_ids" widget="one2many" context="{'show_attribute': False}">
                        <list string="Variants" editable="bottom" decoration-info="value_count &lt;= 1">
                            <field name="value_count" column_invisible="True"/>
                            <field name="sequence" widget="handle"/>
                            <field name="attribute_id" readonly="id"/>
                            <field name="value_ids" widget="many2many_tags" options="{'no_create_edit': True, 'color_field': 'color'}" context="{'default_attribute_id': attribute_id, 'show_attribute': False}"/>
                            <button string="Configure" class="float-end btn-secondary" type="object" name="action_open_attribute_values" groups="product.group_product_variant"/>
                        </list>
                    </field>
                        <p class="opacity-50 oe_edit_only">
                        <strong>Warning</strong>: adding or deleting attributes
                        will delete and recreate existing variants and lead
                        to the loss of their possible customizations.
                    </p>
                </page>
            </xpath>
            <xpath expr="//group[@name='group_standard_price']" position="after">
                <field name="product_properties" columns="2"/>
            </xpath>
        </data>