<?xml version="1.0" encoding="utf-8" ?>
<odoo>
    <record id="product_normal_form_view" model="ir.ui.view">
        <field name="name">sale_order_global_discount.product_normal_form_view</field>
        <field name="model">product.product</field>
        <field name="priority" eval="16" />
        <field name="inherit_id" ref="product.product_normal_form_view" />
        <field name="arch" type="xml">
            <xpath expr="//group[@name='group_standard_price']" position="inside">
                <field
                    name="bypass_global_discount"
                    groups="base_global_discount.group_global_discount"
                />
            </xpath>
        </field>
    </record>
    <record id="product_template_only_form_view" model="ir.ui.view">
        <field name="name">product.template.sale_order_global_discount.form</field>
        <field name="model">product.template</field>
        <field name="priority" eval="24" />
        <field name="inherit_id" ref="product.product_template_only_form_view" />
        <field name="arch" type="xml">
            <xpath expr="//group[@name='group_standard_price']" position="inside">
                <field
                    name="bypass_global_discount"
                    invisible="product_variant_count > 1"
                    groups="base_global_discount.group_global_discount"
                />
            </xpath>
        </field>
    </record>
</odoo>
