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

    <record id="hr_department_hierarchy_view" model="ir.ui.view">
        <field name="name">hr.departmnent.view.hierarchy</field>
        <field name="model">hr.department</field>
        <field name="arch" type="xml">
            <hierarchy child_field="child_ids" draggable="1">
                <field name="name" />
                <field name="color" />
                <field name="total_employee" />
                <templates>
                    <t t-name="hierarchy-box">
                        <div t-attf-class="o_hierarchy_node_header d-flex justify-content-center align-items-center o_hierarchy_node_color_{{ record.color.raw_value }}">
                            <field name="name" />
                        </div>
                        <div class="o_hierarchy_node_body d-flex flex-column">
                            <field name="manager_id" class="pt-1 ps-1" widget="many2one_avatar_employee" />
                            <div>
                                <button class="btn btn-link" name="action_employee_from_department" type="object">
                                    <t t-out="record.total_employee.raw_value"/> Employees
                                </button>
                            </div>
                        </div>
                    </t>
                </templates>
            </hierarchy>
        </field>
    </record>

    <record id="act_hr_department_hierarchy_view_kanban_action" model="ir.actions.act_window.view">
        <field name="sequence" eval="25"/>
        <field name="view_mode">hierarchy</field>
        <field name="act_window_id" ref="hr.hr_department_kanban_action"/>
    </record>

    <record id="act_hr_department_hierarchy_view_tree_action" model="ir.actions.act_window.view">
        <field name="sequence" eval="25"/>
        <field name="view_mode">hierarchy</field>
        <field name="act_window_id" ref="hr.hr_department_tree_action"/>
    </record>

</odoo>
