<?xml version="1.0" encoding="utf-8" ?>
<odoo>
    <!--
        License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).
    -->
    <record id="hr_timesheet_action_from_department" model="ir.actions.act_window">
        <field name="name">Timesheets to Review</field>
        <field name="res_model">hr_timesheet.sheet</field>
        <field name="view_mode">tree,form</field>
        <field name="context">{
            'search_default_department_id': [active_id],
            'default_department_id': active_id,
            'search_default_to_review': 1}
        </field>
    </record>
    <!--Hr Department Inherit Kanban view-->
    <record id="hr_department_view_kanban" model="ir.ui.view">
        <field name="name">hr.department.kanban.inherit</field>
        <field name="model">hr.department</field>
        <field name="inherit_id" ref="hr.hr_department_view_kanban" />
        <field name="arch" type="xml">
            <xpath expr="//templates" position="before">
                <field
                    name="timesheet_sheet_to_approve_count"
                    groups="hr_timesheet.group_hr_timesheet_user"
                />
            </xpath>
            <xpath expr="//div[hasclass('o_kanban_primary_right')]" position="inside">
                <div
                    t-if="record.timesheet_sheet_to_approve_count.raw_value > 0"
                    class="row"
                    groups="hr_timesheet.group_hr_timesheet_user"
                >
                    <div class="col-xs-9">
                        <a
                            name="%(hr_timesheet_sheet.hr_timesheet_action_from_department)d"
                            type="action"
                        >
                            Timesheets
                        </a>
                    </div>
                    <div class="col-xs-3">
                        <t t-esc="record.timesheet_sheet_to_approve_count.raw_value" />
                    </div>
                </div>
            </xpath>
            <xpath expr="//div[hasclass('o_kanban_manage_reports')]" position="inside">
                <div class="row" groups="hr_timesheet.group_hr_timesheet_user">
                    <div class="col-xs-12 text-left">
                        <a
                            name="%(hr_timesheet_sheet.hr_timesheet_action_from_department)d"
                            type="action"
                        >
                            <t
                                t-esc="record.timesheet_sheet_to_approve_count.raw_value or 0"
                            /> Timesheets
                        </a>
                    </div>
                </div>
            </xpath>
        </field>
    </record>
</odoo>
