<?xml version="1.0" encoding="utf-8"?>
<odoo>

    <!-- Brand smart button + Create Brand on vendor contacts -->
    <record id="view_partner_form_fi_brand" model="ir.ui.view">
        <field name="name">res.partner.form.fusion.inventory.brand</field>
        <field name="model">res.partner</field>
        <field name="inherit_id" ref="base.view_partner_form"/>
        <field name="arch" type="xml">
            <xpath expr="//div[@name='button_box']" position="inside">
                <button class="oe_stat_button" name="action_view_brands"
                        type="object" icon="fa-tags"
                        invisible="brand_count == 0">
                    <field string="Brands" name="brand_count" widget="statinfo"/>
                </button>
                <button class="oe_stat_button" name="action_create_brand"
                        type="object" icon="fa-plus-circle"
                        string="Create Brand"
                        invisible="supplier_rank == 0 or brand_count &gt; 0"/>
            </xpath>
        </field>
    </record>

</odoo>
