<?xml version="1.0" encoding="utf-8"?>
<odoo>
    <!-- Vista de lista de pagos -->
    <record id="view_skeen_pago_tree" model="ir.ui.view">
        <field name="name">skeen.pago.tree</field>
        <field name="model">skeen.pago</field>
        <field name="arch" type="xml">
            <tree>
                <field name="name"/>
                <field name="partner_id"/>
                <field name="amount"/>
                <field name="payment_method"/>
                <field name="state"/>
                <field name="create_date"/>
            </tree>
        </field>
    </record>

    <!-- Vista de formulario de pagos -->
    <record id="view_skeen_pago_form" model="ir.ui.view">
        <field name="name">skeen.pago.form</field>
        <field name="model">skeen.pago</field>
        <field name="arch" type="xml">
            <form>
                <header>
                    <button name="action_confirm_payment" string="Confirmar Pago" type="object" invisible="state != 'processing'" class="oe_highlight"/>
                    <button name="action_refund" string="Reembolsar" type="object" invisible="state != 'completed'"/>
                    <field name="state" widget="statusbar" statusbar_visible="pending,processing,completed,failed,refunded"/>
                </header>
                <sheet>
                    <group>
                        <group>
                            <field name="name" readonly="1"/>
                            <field name="partner_id"/>
                            <field name="cita_id"/>
                        </group>
                        <group>
                            <field name="amount"/>
                            <field name="currency_id"/>
                            <field name="payment_method"/>
                        </group>
                    </group>
                    <group>
                        <field name="provider_reference" readonly="1"/>
                        <field name="payment_url" readonly="1"/>
                    </group>
                </sheet>
            </form>
        </field>
    </record>

    <!-- Acción para pagos -->
    <record id="action_skeen_pago_tree" model="ir.actions.act_window">
        <field name="name">Pagos</field>
        <field name="res_model">skeen.pago</field>
        <field name="view_mode">tree,form</field>
    </record>
</odoo>