{
    "name": "Xenoptics Leave Approval Extensions",
    "version": "19.0.2.110.0",
    "summary": "Configurable approval chains + HR override actions for Time Off",
    "description": """
Feature-parity additions for the XENHR -> Odoo migration's Leave module:

- Multi-step leave approval chain (v2), ported from XENHR's real
  ApproverConfigController/LeaveApprovalStep source: xeno.leave.approver is
  now an ordered per-department/per-employee step template (employee
  overrides fully replace the department chain when configured, both
  always end in a synthetic "any HR/Admin" final step). Submitting a leave
  snapshots the resolved chain onto xeno.leave.approval.step; each step is
  approved individually (previous steps must already be approved), and the
  leave itself only transitions to Approved when the last step clears --
  rejecting any single step rejects the whole request, matching XENHR
  exactly. Legacy leaves with no snapshot fall back to the old, simpler
  behavior unchanged.
- HR override on hr.leave: force-approve / force-reject regardless of
  current state, and an HR Update wizard to edit dates/type on a
  leave application after submission -- both restricted to Time Off
  Officers/Responsible, both logged to the chatter for an audit trail.
- "My Team Leaves" action: leaves currently pending at a stage where the
  logged-in user is the configured approver (employee-specific rule wins,
  else department rule, else falls back to normal group-based access so
  nothing already working today gets locked out).
- Per-leave-type request timing limits (advance notice / max backdate),
  mirroring XENHR's leave_types.advance_days / max_backdate_days and its
  exact validation priority -- enforced on self-service creation only,
  bypassed for Time Off Officers creating on an employee's behalf (same
  as XENHR's storeForEmployee).
- Terminology: relabels Odoo's standard approval action buttons on both
  hr.leave and hr.leave.allocation (form/list/kanban) from "Validate"/
  "Refuse" to "Approve"/"Reject", so the wording matches this module's own
  Force Approve/Force Reject buttons. Also renames the native Time Off
  app's own menus/actions/filters to match company terminology: "Time Off"
  -> "Leaves", "My Time Off" -> "My Leaves", "Allocations" -> "Leave
  Balances", "My Allocations" -> "My Leave Balance".
- New standalone "HR" app (additive -- Employees/Attendances/Leave are
  untouched) with two custom pages styled after XENHR's own screens:
  "Leave List" (pill status tabs, Department/Employee/Leave Type filters,
  Export/Import/New Request, per-row approval-chain stepper, Edit/Add
  Approver/Override/Cancel actions -- system deductions are hidden by
  default, with two independent "Show Company holiday deductions"/"Show
  Late deductions" checkboxes to reveal each kind, keyed off
  xeno_system_deduction_type) and
  "Leave Approval" (Pending My Approval with a Your Step/Full Chain view
  and Approve/Reject, plus a My Team Leaves history section below). Both
  are thin OWL front-ends over the existing approval-chain data/actions
  above -- no new approval logic, just a different, XENHR-matching UI.
- Leave form's chatter: the message/log timeline is hidden by default
  behind a new "History" button next to Activity, on the Leave form
  only (every other model's chatter is untouched). Send message/Log
  note/Activity/History are further hidden entirely from a regular
  employee viewing their own leave -- HR-officer tooling, not something
  a requester needs -- and only shown to Time Off Officers/Administrators.
- Leave form's Approval Chain section: same avatar/connector stepper
  widget as the HR app's Leave List page (read-only, fetched
  independently of the underlying create/delete-disabled list view),
  now also showing who decided each step and when.
- Leave Approval page: Approve/Reject now open a confirmation dialog
  first -- the chain, the leave being decided, the employee's other
  leaves that year (same query as hr_holidays' own "Employee's summary"
  widget), and an optional note posted to the leave's chatter alongside
  the decision.
- That same decision dialog also shows an "Analysis" checklist (advisory
  only, never blocks the decision): requests already this calendar month,
  requests in the trailing 90 days, pace vs. a prorated yearly allocation
  (allocation/12 x month number), remaining balance if approved, and
  whether this short request sits right next to a public holiday
  (possible bridging). The same checklist also appears directly on the
  leave form itself, below core's own "Employee's summary" widget --
  visible to Time Off Officers/Administrators only. Hidden entirely for
  any system-driven deduction (xeno_is_system_deduction) -- currently the
  Company Holiday Deduction wizard/automatic hook, with the same flag
  meant for a future Late Deduction feature too -- someone else chose the
  employee/type/days directly, so the self-service frequency/pace checks
  don't apply.
- "Employee's summary" (both the leave form's own sidebar widget and the
  Leave Approval decision dialog) is now a table grouped by leave type --
  one rowspan'd type cell, one row per leave under it -- instead of a flat
  per-leave list, for clearer scanning when someone has several leaves of
  the same type in the year.
- The approver's action email (leave_email.py) now also shows the same
  Analysis checklist, ported to Python since an email can't load the
  browser-side JS -- kept in sync by hand, same thresholds/wording.
  Skipped for a system-driven deduction, same as the two web-side spots.
- Daily cron: when an approved Maternity Leave ends and the employee is
  back at work the next day, post a congratulations message on their
  employee record and email them -- once per leave, date-driven rather
  than tied to their actual first attendance scan. The email reuses the
  same branded shell as xeno_theme_slate's birthday wishes, and the
  employee's own landing page shows a welcome-back banner on that day too
  (xeno_is_welcome_back_today), same delivery pattern as birthdays.
- "Leave Balances" page (HR app): List view (one row per allocation,
  Allocated/Used/Pending/Remaining with a remaining-vs-allocated bar) and
  Grid view (employee x leave-type pivot, with an Edit Mode toggle for
  inline-adjusting Allocated) -- reuses hr.leave.allocation's existing
  number_of_days/xeno_used_days/xeno_remaining_days fields, matching
  XENHR's own Leave Balances screen. Template/Import/Export target the
  same hr.leave.allocation model as the existing Allocations page.
- Further terminology: "Time Off Request" -> "Leave Request" (including
  the Time Off calendar's own click-to-create/edit dialog titles, which
  bypass the action name entirely), "Time Off Type" -> "Leave Type" (the
  holiday_status_id field label), "New Time Off" -> "New Leave", and the
  overlap dashboard warning's own wording ("booked time off" -> "requested
  leave").
- Same-day overlap is now a hard rule, not just core's dashboard warning:
  an employee can't submit a new leave that overlaps the date range of an
  existing one of theirs unless that earlier request has already been
  cancelled or rejected.
- Automated monthly HR report email: on the 16th of every month, an xlsx
  + PDF Leave Balance Report (Allocated/Used/Remaining per employee per
  type) and an xlsx + PDF Attendance Report (reusing xeno_attendance's own
  Monthly Attendance report for the month just ended) are emailed to
  whoever is configured under Settings > Employees > Monthly HR Report
  Recipients. Same daily-checked, date-gated cron idiom as the late
  check-in deduction below.
- Automated late check-in deduction: 10 minutes of late check-in per
  month is forgiven company-wide; the excess (sourced from
  xeno_attendance's own monthly late-minutes computation) is deducted as
  a fractional leave day from Annual Leave if its balance covers it,
  otherwise Personal Leave. Runs via a daily-checked cron that only acts
  in the first week of the month (processing the month just ended) and/or
  a manual "Late Check-in Deduction" button on the Leave List page;
  idempotent per employee/month either way (xeno.late.deduction.log).
- Leave Request Import (Leave List page's "Template"/"Import" buttons),
  ported from XENHR's own LeaveApplicationsImport.php: a business-friendly
  xlsx import keyed on Employee Name (case-insensitive exact match; an
  ambiguous shared name is skipped and reported with each match's Employee
  Code) and the leave type's trailing code (e.g. "AL" from "Annual Leave .
  AL"), not internal database ids, that can
  backfill historical leaves already in a decided state (approved/
  rejected/cancelled), not just pending ones. Row-by-row validated -- a bad
  row (unknown code, date overlap, missing part-time hours, etc.) is
  skipped and reported, the rest of the file still imports. Approving/
  rejecting an imported row reuses the same silent HR-direct-create bypass
  as the "Create Leave (HR)" wizard, so backfilling old records doesn't
  spam employees with real decision emails for years-old leave.
""",
    "author": "Xenoptics",
    "license": "LGPL-3",
    "category": "Human Resources/Time Off",
    "depends": ["hr_holidays", "xeno_attendance", "xeno_resignation", "xeno_theme_slate"],
    "data": [
        "security/ir.model.access.csv",
        "security/leave_security.xml",
        "views/leave_approver_views.xml",
        "views/leave_type_views.xml",
        "wizard/leave_hr_update_views.xml",
        "wizard/leave_approver_preview_views.xml",
        "wizard/leave_add_approver_views.xml",
        "views/hr_leave_views.xml",
        "views/leave_approval_status_views.xml",
        "views/leave_allocation_views.xml",
        "views/leave_terminology_views.xml",
        "views/hr_app_menu.xml",
        "wizard/leave_hr_create_views.xml",
        "wizard/leave_holiday_deduct_views.xml",
        "wizard/leave_late_deduct_views.xml",
        "views/hr_app_menu_shortcuts.xml",
        "views/hr_business_trip_hr_views.xml",
        "views/leave_validation_rule_views.xml",
        "views/res_config_settings_views.xml",
        "data/ir_cron.xml",
        "data/leave_validation_rules.xml",
    ],
    "assets": {
        "web.assets_backend": [
            "xeno_leave/static/src/xml/pivot_measure_color.xml",
            "xeno_leave/static/src/scss/pivot_measure_color.scss",
            "xeno_leave/static/src/scss/leave_apply_form.scss",
            "xeno_leave/static/src/js/leave_hr_common.js",
            "xeno_leave/static/src/js/leave_type_colors.js",
            "xeno_leave/static/src/js/leave_analysis.js",
            "xeno_leave/static/src/js/leave_import_result_dialog.js",
            "xeno_leave/static/src/xml/leave_import_result_dialog_templates.xml",
            "xeno_leave/static/src/js/leave_list_action.js",
            "xeno_leave/static/src/js/leave_approval_action.js",
            "xeno_leave/static/src/xml/leave_list_templates.xml",
            "xeno_leave/static/src/xml/leave_approval_templates.xml",
            "xeno_leave/static/src/scss/leave_hr_app.scss",
            "xeno_leave/static/src/js/chatter_history_patch.js",
            "xeno_leave/static/src/xml/chatter_history_templates.xml",
            "xeno_leave/static/src/js/leave_approval_chain_widget.js",
            "xeno_leave/static/src/xml/leave_approval_chain_widget_templates.xml",
            "xeno_leave/static/src/js/leave_decision_dialog.js",
            "xeno_leave/static/src/xml/leave_decision_dialog_templates.xml",
            "xeno_leave/static/src/js/leave_analysis_widget.js",
            "xeno_leave/static/src/xml/leave_analysis_widget_templates.xml",
            "xeno_leave/static/src/js/leave_stats_patch.js",
            "xeno_leave/static/src/xml/leave_stats_patch_templates.xml",
            "xeno_leave/static/src/js/leave_approver_config_action.js",
            "xeno_leave/static/src/xml/leave_approver_config_templates.xml",
            "xeno_leave/static/src/scss/leave_approver_config.scss",
            "xeno_leave/static/src/js/grid_export_dialog.js",
            "xeno_leave/static/src/xml/grid_export_dialog_templates.xml",
            "xeno_leave/static/src/js/leave_balance_action.js",
            "xeno_leave/static/src/xml/leave_balance_templates.xml",
            "xeno_leave/static/src/scss/leave_balance.scss",
            "xeno_leave/static/src/js/calendar_terminology_patch.js",
            "xeno_leave/static/src/js/leave_type_config_action.js",
            "xeno_leave/static/src/xml/leave_type_config_templates.xml",
            "xeno_leave/static/src/js/work_schedule_config_action.js",
            "xeno_leave/static/src/xml/work_schedule_config_templates.xml",
            "xeno_leave/static/src/scss/leave_type_config.scss",
            "xeno_leave/static/src/js/employee_list_action.js",
            "xeno_leave/static/src/xml/employee_list_templates.xml",
            "xeno_leave/static/src/scss/employee_list.scss",
        ],
    },
    "installable": True,
    "application": False,
}
