<?xml version="1.0" encoding="utf-8"?>
<odoo>
    <data>
        <record id="action_xeno_hr_leave_list" model="ir.actions.client">
            <field name="name">Leave List</field>
            <field name="tag">xeno_leave_list</field>
        </record>

        <record id="action_xeno_hr_leave_approval" model="ir.actions.client">
            <field name="name">Leave Approval</field>
            <field name="tag">xeno_leave_approval</field>
        </record>

        <record id="action_xeno_hr_leave_balance" model="ir.actions.client">
            <field name="name">Leave Balances</field>
            <field name="tag">xeno_leave_balance</field>
        </record>

        <!-- Core's own hr_holidays.hr_leave_report_action hardcodes
             'default_department_id': active_id / 'search_default_department_id':
             [active_id] in its context, which is fine where core itself uses it
             (a Department kanban card's own "Manage" dropdown, which always has
             that department's id as active_id), but core never exposes it as a
             plain top-level menu item anywhere. Pointing this "Leave Reports"
             top-level entry straight at that action throws
             "Name 'active_id' is not defined" since a menu click has no active
             record. This local copy drops the two active_id-dependent keys and
             keeps the rest (group by Employee/Type/Month) identical. -->
        <record id="action_xeno_hr_leave_report" model="ir.actions.act_window">
            <field name="name">Time Off Analysis</field>
            <field name="res_model">hr.leave.report</field>
            <field name="view_mode">graph,pivot</field>
            <field name="context">{
                'search_default_group_employee': 1,
                'search_default_group_type': 1,
                'search_default_group_date_from': 'month',
            }
            </field>
        </record>
    </data>
    <data noupdate="1">
        <!-- New standalone "HR" app, additive to Odoo's existing Employees/
             Attendances/Leave apps (left untouched); houses XENHR-styled
             pages built on the same underlying hr.leave / approval-chain
             data, per susu's screenshots of XENHR's own Leaves and
             "My Team Leaves" (approver) pages. -->
        <menuitem id="menu_xeno_hr_root"
                  name="HR"
                  sequence="26"
                  web_icon="xeno_leave,static/description/icon.png"
                  groups="hr_holidays.group_hr_holidays_user"/>

        <!-- Group container (no action of its own). The sidebar's submenu
             renderer (xeno_theme_slate.SidebarSubMenuItems) is generic: any
             menu with children renders as an indented group label instead of
             a clickable leaf, purely from this hierarchy. Create Leave
             Request / Deduct Leave for Company Holiday (defined in their own
             wizard view files) are reparented into this same group below. -->
        <menuitem id="menu_xeno_hr_leaves"
                  name="Leave Management"
                  parent="menu_xeno_hr_root"
                  sequence="4"/>

        <menuitem id="menu_xeno_hr_leave_list"
                  name="Leave Requests"
                  parent="menu_xeno_hr_leaves"
                  action="action_xeno_hr_leave_list"
                  sequence="1"/>

        <menuitem id="menu_xeno_hr_leave_balance"
                  name="Leave Balances"
                  parent="menu_xeno_hr_leaves"
                  action="action_xeno_hr_leave_balance"
                  sequence="2"/>

        <menuitem id="menu_xeno_hr_leave_approval"
                  name="Team Leave"
                  parent="menu_xeno_hr_leaves"
                  action="action_xeno_hr_leave_approval"
                  sequence="3"/>

        <!-- "Approval Chain" and "Leave Approvers" are the same underlying
             configuration page as Organization > Approver Setup
             (xeno_leave.action_xeno_leave_approver_config, which already
             covers configuring both who approves and the multi-step chain),
             shown again here under Leave Management to match the requested
             menu structure, not a separate feature. -->
        <menuitem id="menu_xeno_hr_leaves_approval_chain"
                  name="Approval Chain"
                  parent="menu_xeno_hr_leaves"
                  action="action_xeno_leave_approver_config"
                  sequence="4"/>

        <menuitem id="menu_xeno_hr_leaves_approvers"
                  name="Leave Approvers"
                  parent="menu_xeno_hr_leaves"
                  action="action_xeno_leave_approver_config"
                  sequence="5"/>

        <!-- New top-level groups (Recruitment / Organization / Reports /
             Settings), populated below and by other modules' own shortcut
             files (matching this file's existing "shortcut duplicate"
             convention, see hr_app_menu_shortcuts.xml's header comment). -->
        <menuitem id="menu_xeno_hr_recruitment"
                  name="Recruitment"
                  parent="menu_xeno_hr_root"
                  sequence="5"/>

        <!-- Recruitment itself isn't available: the hr_recruitment app isn't
             installed on this database, so there's no applicant pipeline page
             to link here. Contract Templates has no dedicated
             contract-template feature either (hr_contract isn't installed),
             so this points at the closest native equivalent, Employment Types. -->
        <menuitem id="menu_xeno_hr_recruitment_contract_templates"
                  name="Contract Templates"
                  parent="menu_xeno_hr_recruitment"
                  action="hr.hr_contract_type_action"
                  sequence="1"/>

        <menuitem id="menu_xeno_hr_organization"
                  name="Organization"
                  parent="menu_xeno_hr_root"
                  sequence="6"/>

        <menuitem id="menu_xeno_hr_reports"
                  name="Reports"
                  parent="menu_xeno_hr_root"
                  sequence="8"/>

        <!-- Employee Reports and Skills Reports have no backing page: no
             native or custom employee-analysis report exists, and hr_skills
             (installed) only ships a Skill Types configuration list, not an
             actual report. -->

        <menuitem id="menu_xeno_hr_reports_leave"
                  name="Leave Reports"
                  parent="menu_xeno_hr_reports"
                  action="action_xeno_hr_leave_report"
                  sequence="1"/>

        <menuitem id="menu_xeno_hr_reports_attendance"
                  name="Attendance Reports"
                  parent="menu_xeno_hr_reports"
                  action="hr_attendance.hr_attendance_reporting"
                  sequence="2"/>

        <menuitem id="menu_xeno_hr_settings"
                  name="Settings"
                  parent="menu_xeno_hr_root"
                  sequence="9"/>

        <menuitem id="menu_xeno_hr_settings_config"
                  name="System Configuration"
                  parent="menu_xeno_hr_settings"
                  action="base_setup.action_general_configuration"
                  sequence="2"/>
    </data>
</odoo>
