<?xml version="1.0" encoding="UTF-8" ?>
<odoo>
    <template id="product_configurator_configure_inherit" name="Configure" inherit_id="sale.product_configurator_configure">
        <xpath expr="//input[@t-attf-name='product_id']" position="after">
            <input type="hidden" class="start_product_id" t-attf-name="start_product_id" t-att-value="start_product_variant_id"/>
        </xpath>
    </template>

    <template id="variants_inherit" inherit_id="sale.variants">
        <xpath expr="//t[@t-set='attribute_exclusions']" position="after">
            <t t-set="attribute_value_defaults" t-value="product.get_default_attribute_values(sale_line)"/>
        </xpath>
        <xpath expr="//t[@t-foreach='variant_id.product_template_value_ids']/option" position="attributes">
            <attribute name="t-att-data-is_custom">value_id.is_custom</attribute>
            <attribute name="t-att-selected">'selected' if value_id.product_attribute_value_id in attribute_value_defaults else None</attribute>
        </xpath>
        <xpath expr="//t[@t-foreach='variant_id.product_template_value_ids']/li/label/div/input" position="attributes">
            <attribute name="t-att-checked">'checked' if value_id.product_attribute_value_id in attribute_value_defaults else None</attribute>
        </xpath>
        <xpath expr="//li[@t-foreach='variant_id.product_template_value_ids']/label" position="attributes">
            <attribute name="t-attf-class">css_attribute_color #{'active' if value_id.product_attribute_value_id in attribute_value_defaults else ''} #{'custom_value' if value_id.is_custom else ''}</attribute>
        </xpath>
        <xpath expr="//li[@t-foreach='variant_id.product_template_value_ids']/label/input" position="attributes">
            <attribute name="t-att-checked">'checked' if value_id.product_attribute_value_id in attribute_value_defaults else None</attribute>
        </xpath>
    </template>
</odoo>