<?xml version="1.0" encoding="utf-8" ?>
<!-- Copyright 2017 ForgeFlow
     License LGPL-3.0 or later (http://www.gnu.org/licenses/agpl). -->
<odoo>
    <record id="view_stock_request_form" model="ir.ui.view">
        <field name="name">stock.request.form</field>
        <field name="model">stock.request</field>
        <field name="inherit_id" ref="stock_request.view_stock_request_form" />
        <field name="groups_id" eval="[(4, ref('purchase.group_purchase_user'))]" />
        <field name="arch" type="xml">
            <div name="button_box" position="inside">
                <field name="purchase_ids" invisible="1" />
                <button
                    type="object"
                    name="action_view_purchase"
                    class="oe_stat_button"
                    icon="fa-truck"
                    attrs="{'invisible': [('purchase_count', '=', 0)]}"
                >
                    <field name="purchase_count" widget="statinfo" string="Purchase" />
                </button>
            </div>
        </field>
    </record>
</odoo>
