<?xml version="1.0" encoding="UTF-8"?>
<odoo>
    <record id="view_sale_order_loaner_stat_button" model="ir.ui.view">
        <field name="name">sale.order.loaner.stat.button</field>
        <field name="model">sale.order</field>
        <field name="inherit_id" ref="sale.view_order_form"/>
        <field name="arch" type="xml">
            <xpath expr="//div[@name='button_box']" position="inside">
                <button name="action_view_loaners" type="object"
                        class="oe_stat_button" icon="fa-wheelchair"
                        invisible="x_fc_loaner_count == 0">
                    <field name="x_fc_loaner_count" widget="statinfo" string="Loaners"/>
                </button>
            </xpath>
        </field>
    </record>
</odoo>
