<?xml version="1.0" ?>
<!-- Copyright 2018-2019 ForgeFlow, S.L.
     License LGPL-3.0 or later (https://www.gnu.org/licenses/lgpl-3.0) -->
<odoo>
    <record id="purchase_order_form" model="ir.ui.view">
        <field name="name">purchase.order.form</field>
        <field name="model">purchase.order</field>
        <field name="inherit_id" ref="purchase.purchase_order_form" />
        <field name="arch" type="xml">
            <xpath expr="//field[@name='order_line']/tree" position="inside">
                <field name="purchase_request_lines" invisible="1" />
                <button
                    attrs="{'invisible': [('purchase_request_lines', '=', [])]}"
                    name="action_open_request_line_tree_view"
                    title="Request Lines"
                    type="object"
                    icon="fa-folder-open-o"
                />
            </xpath>
        </field>
    </record>
    <record id="purchase_order_line_form2" model="ir.ui.view">
        <field name="name">purchase.order.line.form2</field>
        <field name="model">purchase.order.line</field>
        <field name="inherit_id" ref="purchase.purchase_order_line_form2" />
        <field name="arch" type="xml">
            <field name="name" position="after">
                <separator string="Purchase Request Lines" />
                <field name="purchase_request_lines" />
            </field>
        </field>
    </record>
    <record id="purchase_order_line_tree" model="ir.ui.view">
        <field name="name">purchase.order.line.tree</field>
        <field name="model">purchase.order.line</field>
        <field name="inherit_id" ref="purchase.purchase_order_line_tree" />
        <field name="arch" type="xml">
            <xpath expr="//tree" position="inside">
                <field name="purchase_request_lines" invisible="1" />
                <button
                    attrs="{'invisible': [('purchase_request_lines', '=', [])]}"
                    name="action_open_request_line_tree_view"
                    title="Request Lines"
                    type="object"
                    icon="fa-folder-open-o"
                />
            </xpath>
        </field>
    </record>
</odoo>
