<?xml version="1.0" encoding="utf-8"?>
<odoo>
    <!-- Form View for Sample Rejection Wizard -->
    <record id="view_lims_sample_rejection_wizard_form" model="ir.ui.view">
        <field name="name">lims.sample.rejection.wizard.form</field>
        <field name="model">lims.sample.rejection.wizard</field>
        <field name="arch" type="xml">
            <form string="Rechazar Muestra">
                <sheet>
                    <group>
                        <group>
                            <field name="sample_id" options="{'no_create': True, 'no_open': True}"/>
                            <field name="rejection_reason_id" options="{'no_create': True}"/>
                        </group>
                        <group>
                            <field name="requires_new_sample" invisible="1"/>
                            <field name="create_new_sample" 
                                   invisible="not requires_new_sample"/>
                        </group>
                    </group>
                    <group string="Información Adicional">
                        <field name="rejection_notes" placeholder="Agregue cualquier información relevante sobre el rechazo..."/>
                    </group>
                </sheet>
                <footer>
                    <button name="action_reject_sample" 
                            string="Rechazar Muestra" 
                            type="object" 
                            class="btn-primary"
                            confirm="¿Está seguro de rechazar esta muestra? Esta acción no se puede deshacer."/>
                    <button string="Cancelar" class="btn-secondary" special="cancel"/>
                </footer>
            </form>
        </field>
    </record>

    <!-- Action for Sample Rejection Wizard -->
    <record id="action_lims_sample_rejection_wizard" model="ir.actions.act_window">
        <field name="name">Rechazar Muestra</field>
        <field name="res_model">lims.sample.rejection.wizard</field>
        <field name="view_mode">form</field>
        <field name="target">new</field>
        <field name="context">{'default_sample_id': active_id}</field>
    </record>
</odoo>