<?xml version="1.0" encoding="utf-8" ?>
<odoo>
    <record id="hr_equipment_view_kanban" model="ir.ui.view">
        <field name="name">equipment.kanban</field>
        <field name="model">maintenance.equipment</field>
        <field name="inherit_id" ref="maintenance.hr_equipment_view_kanban" />
        <field name="arch" type="xml">
            <templates position="before">
                <field name="in_use" groups="maintenance.group_equipment_manager" />
            </templates>
            <xpath expr="//t[@t-name='card']" position="inside">
                <span
                    groups="maintenance.group_equipment_manager"
                    class="label label-primary"
                    invisible="not in_use"
                >In use</span>
            </xpath>
        </field>
    </record>
    <record id="hr_equipment_view_form" model="ir.ui.view">
        <field name="name">equipment.form</field>
        <field name="model">maintenance.equipment</field>
        <field name="inherit_id" ref="maintenance.hr_equipment_view_form" />
        <field name="arch" type="xml">
            <div name="button_box" position="inside">
                <button
                    class="oe_stat_button"
                    type="action"
                    name="%(maintenance_equipment_usage_action_from_equipment)d"
                    icon="fa-calendar"
                    groups="maintenance.group_equipment_manager"
                >
                    <field string="Usages" name="usage_count" widget="statinfo" />
                </button>
            </div>
            <xpath expr="//div[hasclass('oe_title')]" position="after">
                <field name="in_use" invisible="1" />
                <span
                    groups="maintenance.group_equipment_manager"
                    class="label label-primary"
                    invisible="not in_use"
                >In use</span>
            </xpath>
        </field>
    </record>
</odoo>
