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

    <record id="product_configurator_form" model="ir.ui.view">
        <field name="name">product.configurator</field>
        <field name="model">product.configurator</field>
        <field name="arch" type="xml">
            <form>
                <header>
                    <field name="state" widget="statusbar" clickable="True" />
                    <button
                        string="Reset"
                        type="object"
                        name="action_reset"
                        confirm="Are you sure? This will remove your current configuration for this template!"
                        special="no_save"
                        class="oe_highlight"
                        attrs="{'invisible': ['|', ('product_tmpl_id', '=', False), ('state', '=', 'select')]}"
                    />
                </header>
                <sheet>
                    <field
                        attrs="{'invisible': [('product_img', '=', False)]}"
                        name="product_img"
                        readonly="1"
                        nolabel="1"
                        widget="image"
                    />
                    <group col="3">
                        <group name='static_form' states='select' colspan="2">
                            <field
                                name="config_session_id"
                                required="context.get('wizard_id')"
                                invisible="1"
                            />
                            <field name="product_id" invisible="1" />
                            <field name="currency_id" invisible="1" />
                            <field
                                name="product_tmpl_id"
                                readonly="context.get('product_tmpl_id_readonly', False)"
                                required="True"
                                options="{'no_create': True}"
                                force_save="1"
                            />
                            <field
                                name="product_preset_id"
                                invisible="not context.get('allow_preset_selection')"
                                options="{'no_create': True}"
                            />
                            <separator
                                string="To reset/change the Preset Please close and start the configuration again"
                                invisible="context.get('allow_preset_selection')"
                                colspan="2"
                            />
                            <field
                                attrs="{'invisible': [('attribute_line_ids', '=', [])]}"
                                name="attribute_line_ids"
                            >
                                <tree>
                                    <field name="attribute_id" />
                                    <field name="custom" />
                                    <field name="multi" />
                                </tree>
                            </field>
                        </group>
                        <group colspan="1">
                            <field name="weight" />
                            <field
                                name="price"
                                widget='monetary'
                                options="{'currency_field': 'currency_id', 'field_digits': True}"
                            />
                        </group>
                    </group>
                </sheet>
                <footer>
                    <field name="value_ids" readonly="1" force_save="1" invisible="1" />
                    <button
                        type="object"
                        name="action_previous_step"
                        attrs="{'invisible': [('state','=','select')]}"
                        string="Back"
                    />
                    <button
                        type="object"
                        name="action_next_step"
                        class="oe_highlight"
                        string="Next"
                    />
                </footer>
            </form>
        </field>
    </record>

</odoo>
