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

    <!-- Match Sale Order Wizard Form -->
    <record id="view_match_sale_order_wizard" model="ir.ui.view">
        <field name="name">match.sale.order.wiz.form</field>
        <field name="model">match.sale.order.wiz</field>
        <field name="arch" type="xml">
            <form string="Match Sale Order">
                <field name="purchase_order_id" invisible="1"/>
                
                <group>
                    <p class="text-muted" colspan="2">
                        Search and select the Sale Order to link to this Purchase Order.
                    </p>
                </group>
                
                <group>
                    <field name="search_hint" string="Suggested Search" invisible="not search_hint"/>
                    <field name="sale_order_id" 
                        string="Sale Order" 
                        options="{'no_create': True, 'no_quick_create': True}"
                        context="{'search_default_name': search_hint}"
                        />
                </group>
                
                <footer>
                    <button name="action_confirm" string="Link Sale Order" type="object" class="btn-primary"/>
                    <button special="cancel" string="Cancel" class="btn-secondary"/>
                </footer>
            </form>
        </field>
    </record>

    <!-- Action for the wizard -->
    <record id="action_match_sale_order_wizard" model="ir.actions.act_window">
        <field name="name">Match Sale Order</field>
        <field name="res_model">match.sale.order.wiz</field>
        <field name="type">ir.actions.act_window</field>
        <field name="view_mode">form</field>
        <field name="target">new</field>
    </record>

    </data>
</odoo>
