<?xml version="1.0" encoding="utf-8"?>
<odoo>

    <record id="product_label_layout_form" model="ir.ui.view">
        <field name="name">product.label.layout.form.inherit.fusion_labels_pro</field>
        <field name="model">product.label.layout</field>
        <field name="inherit_id" ref="product.product_label_layout_form"/>
        <field name="arch" type="xml">
            <xpath expr="//field[@name='print_format']" position="before">
                <field name="use_alternative_template" widget="boolean_toggle"/>
            </xpath>
            <xpath expr="//field[@name='print_format']" position="attributes">
                <attribute name="invisible">use_alternative_template</attribute>
            </xpath>
            <xpath expr="//field[@name='print_format']" position="after">
                <field name="fusion_allowed_template_ids" invisible="1"/>  <!-- Technical field -->
                <field name="fusion_allowed_template_count" invisible="1"/>  <!-- Technical field -->
                <field name="fusion_show_template_limit" invisible="1"/>  <!-- Technical field -->
                <field name="fusion_label_template_id"
                       domain="[('id', 'in', fusion_allowed_template_ids)]"
                       options="{'no_create': True}"
                       invisible="not use_alternative_template or use_alternative_template and fusion_allowed_template_count &lt;= fusion_show_template_limit"
                       required="use_alternative_template and fusion_allowed_template_count &gt; fusion_show_template_limit"/>
                <field name="fusion_label_template_id"
                       domain="[('id', 'in', fusion_allowed_template_ids)]"
                       options="{'no_create': True}"
                       invisible="not use_alternative_template or use_alternative_template and fusion_allowed_template_count &gt; fusion_show_template_limit"
                       required="use_alternative_template and fusion_allowed_template_count &lt;= fusion_show_template_limit"
                       widget="radio"
                />
            </xpath>
        </field>
    </record>

</odoo>
