<?xml version="1.0" encoding="utf-8" ?>
<odoo>
    <!-- Add purchase orders to refund -->
    <record id="view_invoice_supplier_purchase_form" model="ir.ui.view">
        <field name="model">account.move</field>
        <field name="inherit_id" ref="purchase.view_move_form_inherit_purchase" />
        <field name="arch" type="xml">
            <field name="invoice_vendor_bill_id" position="after">
                <field
                    name="purchase_vendor_bill_id"
                    invisible="state != 'draft' or move_type != 'in_refund'"
                    class="oe_edit_only"
                    domain="[('company_id', '=', company_id), ('partner_id','child_of', [partner_id])]"
                    placeholder="Select a purchase order or an old bill"
                    context="{'show_total_amount': True}"
                    options="{'no_create': True, 'no_open': True}"
                />
            </field>
        </field>
    </record>
</odoo>
