<?xml version="1.0" encoding="UTF-8" ?>
<odoo>
    <record id="view_account_voucher_wizard" model="ir.ui.view">
        <field name="name">Advance Payment</field>
        <field name="model">account.voucher.wizard.purchase</field>
        <field name="type">form</field>
        <field name="arch" type="xml">
            <form string="Advance Payment">
                <group>
                    <group>
                        <field name="order_id" invisible="1" />
                        <field
                            name="journal_id"
                            domain="[('type','in',['bank', 'cash'])]"
                            options="{'no_open': True, 'no_create': True}"
                            required="1"
                        />
                        <field
                            name="payment_method_line_id"
                            required="1"
                            options="{'no_create': True, 'no_open': True}"
                        />
                        <field name="available_payment_method_line_ids" invisible="1" />
                        <field name="amount_total" string="Order Due Amount" />
                        <field name="currency_id" invisible="1" />
                    </group>
                    <group>
                        <label for="amount_advance" />
                        <div name="amount_div" class="o_row">
                            <field name="amount_advance" />
                            <field
                                name="journal_currency_id"
                                string="Currency"
                                required="1"
                                options="{'no_create': True, 'no_open': True}"
                                groups="base.group_multi_currency"
                            />
                        </div>
                        <field
                            name="currency_amount"
                            string="Amount in Order Currency"
                        />
                        <field name="date" />
                        <field name="payment_ref" />
                    </group>

                </group>
                <footer>
                    <button
                        name="make_advance_payment"
                        string="Make advance payment"
                        type="object"
                        class="btn-primary"
                    />
                    <button special="cancel" string="Cancel" class="btn-default" />
                </footer>
            </form>
        </field>
    </record>
    <record id="action_view_account_voucher_wizard" model="ir.actions.act_window">
        <field name="name">Advance Payment</field>
        <field name="type">ir.actions.act_window</field>
        <field name="res_model">account.voucher.wizard.purchase</field>
        <field name="view_mode">form</field>
        <field name="target">new</field>
    </record>
</odoo>
