<?xml version="1.0" encoding="utf-8" ?>
<odoo>
    <record id="view_account_payment_search" model="ir.ui.view">
        <field name="name">account.payment.search</field>
        <field name="model">account.payment</field>
        <field name="inherit_id" ref="account.view_account_payment_search" />
        <field name="arch" type="xml">
            <xpath expr="//search/separator[4]" position="before">
                <separator />
                <filter
                    string="Return Advance"
                    name="return_advance_filter"
                    domain="[('advance_id', '!=', False)]"
                />
            </xpath>
        </field>
    </record>

    <record id="view_account_payment_form" model="ir.ui.view">
        <field name="name">account.payment.form</field>
        <field name="model">account.payment</field>
        <field name="inherit_id" ref="account.view_account_payment_form" />
        <field name="arch" type="xml">
            <xpath expr="//sheet//group[@name='group2']" position="inside">
                <field
                    name="advance_id"
                    attrs="{'invisible': [('payment_type', '!=', 'inbound')]}"
                />
            </xpath>
        </field>
    </record>
</odoo>
