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

    <record id="manual_renewal_wizard_view_form" model="ir.ui.view">
        <field name="name">manual.renewal.wizard.form</field>
        <field name="model">manual.renewal.wizard</field>
        <field name="arch" type="xml">
            <form string="Renew Rental">
                <field name="previous_start_date" invisible="1"/>
                <field name="previous_return_date" invisible="1"/>
                <field name="renewal_invoice_id" invisible="1"/>
                <field name="renewal_log_id" invisible="1"/>

                <group>
                    <field name="order_id" readonly="1"/>
                    <field name="partner_id" readonly="1"/>
                </group>

                <separator string="Current Rental Period"/>
                <group>
                    <group>
                        <field name="current_start_date" readonly="1"/>
                    </group>
                    <group>
                        <field name="current_return_date" readonly="1"/>
                    </group>
                </group>

                <separator string="New Rental Period"/>
                <group>
                    <group>
                        <field name="new_start_date"/>
                    </group>
                    <group>
                        <field name="new_return_date"/>
                    </group>
                </group>

                <group>
                    <field name="amount_preview" widget="monetary"/>
                </group>

                <separator string="Payment"/>
                <group>
                    <group>
                        <field name="payment_token_id"/>
                    </group>
                    <group>
                        <field name="use_card_on_file" widget="boolean_toggle"/>
                    </group>
                </group>

                <footer>
                    <button name="action_confirm_renewal"
                            type="object"
                            string="Confirm Renewal &amp; Collect Payment"
                            class="btn-primary"
                            invisible="not use_card_on_file"/>
                    <button name="action_confirm_renewal"
                            type="object"
                            string="Confirm Renewal &amp; Open Payment"
                            class="btn-primary"
                            invisible="use_card_on_file"/>
                    <button name="action_cancel_renewal"
                            type="object"
                            string="Cancel"
                            class="btn-secondary"/>
                </footer>
            </form>
        </field>
    </record>

</odoo>
