<?xml version="1.0" encoding="utf-8"?>
<odoo>
    <record id="view_assessment_completed_wizard_form" model="ir.ui.view">
        <field name="name">fusion_claims.assessment.completed.wizard.form</field>
        <field name="model">fusion_claims.assessment.completed.wizard</field>
        <field name="arch" type="xml">
            <form string="Assessment Completed">
                <field name="sale_order_id" invisible="1"/>
                <field name="is_override" invisible="1"/>

                <div invisible="not is_override"
                     class="alert alert-warning mb-3" role="alert">
                    <strong>Scheduling Override:</strong>
                    This assessment was not scheduled through the system.
                    A reason is required to proceed.
                </div>

                <group>
                    <group string="Assessment Dates">
                        <field name="assessment_start_date"/>
                        <field name="completion_date"/>
                    </group>
                    <group string="Details">
                        <field name="notes"
                               placeholder="Enter any notes from the assessment..."/>
                        <field name="notify_authorizer"/>
                    </group>
                </group>

                <group invisible="not is_override">
                    <field name="override_reason"
                           required="is_override"
                           placeholder="e.g., Authorizer completed the assessment independently and sent us the application directly..."
                           widget="text"/>
                </group>

                <footer>
                    <button name="action_complete" type="object"
                            string="Mark Complete" class="btn-primary"
                            icon="fa-check"/>
                    <button string="Cancel" class="btn-secondary" special="cancel"/>
                </footer>
            </form>
        </field>
    </record>

    <record id="action_assessment_completed_wizard" model="ir.actions.act_window">
        <field name="name">Assessment Completed</field>
        <field name="res_model">fusion_claims.assessment.completed.wizard</field>
        <field name="view_mode">form</field>
        <field name="target">new</field>
    </record>
</odoo>
