<?xml version="1.0" encoding="utf-8"?>
<odoo>
    
    <!-- Ready for Delivery Wizard Form View -->
    <record id="view_ready_for_delivery_wizard_form" model="ir.ui.view">
        <field name="name">fusion.ready.for.delivery.wizard.form</field>
        <field name="model">fusion.ready.for.delivery.wizard</field>
        <field name="arch" type="xml">
            <form string="Ready for Delivery">
                <group>
                    <group string="Order Information">
                        <field name="sale_order_id" readonly="1"/>
                        <field name="partner_id"/>
                        <field name="claim_number"/>
                        <field name="current_status" widget="badge"/>
                        <field name="is_early_delivery" widget="boolean_toggle"/>
                    </group>
                    <group string="Delivery Details">
                        <field name="delivery_address" readonly="1"/>
                    </group>
                </group>
                
                <separator string="Technician Assignment"/>
                <group>
                    <field name="technician_ids" widget="many2many_tags"
                           domain="[('x_fc_is_field_staff', '=', True)]"
                           options="{'color_field': 'color'}"
                           placeholder="Select delivery technician(s)..."/>
                </group>
                
                <separator string="Scheduling"/>
                <group>
                    <field name="scheduled_datetime"/>
                    <field name="notes" placeholder="Any special delivery instructions..."/>
                </group>
                
                <footer>
                    <button name="action_confirm" type="object" 
                            string="Mark Ready for Delivery" class="btn-primary"
                            icon="fa-truck"/>
                    <button string="Cancel" class="btn-secondary" special="cancel"/>
                </footer>
            </form>
        </field>
    </record>
    
    <!-- Action to open the wizard -->
    <record id="action_ready_for_delivery_wizard" model="ir.actions.act_window">
        <field name="name">Ready for Delivery</field>
        <field name="res_model">fusion.ready.for.delivery.wizard</field>
        <field name="view_mode">form</field>
        <field name="target">new</field>
    </record>
    
</odoo>
