#4193·hrms

Leave Allocation was skipped due to max leave allocation limit set in leave type

Author: neilkrugerCreated Mar 2, 2026Updated Sep 11, 2026
Labelsbug

Information about bug

Error gets logged when scheduler works exactly as it should. This error is created when Leave Accrues at the end of the month and the max balance for that specific leave type has already been maxed.

This is not an error, its base functionality of Frappe HR

Image

Module

HR

Version

Frappe Version 16.9.0 (HEAD) ERPNext Version 16.6.1 (HEAD) Frappe HR Version 16.4.1 (HEAD)

Installation method

None

Relevant log output / Stack trace / Full Error Message.

bash
Traceback with variables (most recent call last):
  File "apps/hrms/hrms/hr/utils.py", line 381, in allocate_earned_leaves
    update_previous_leave_allocation(
      e_leave_types = [frappe.types.frappedict._dict{'name': 'Normal Leave 30 Days', 'max_leaves_allowed': 30.0, 'earned_leave_frequency': 'Monthly', 'rounding': '0.25', 'allocate_on_day': 'Last Day'}, frappe.types.frappedict._dict{'name': 'Normal Leave 22.5 Days', 'max_leaves_allowed': 22.5, 'earned_leave_frequency': 'Monthly', 'rounding': '0.25', 'allocate_on_day': 'Last Day'}]
      today = 2026-02-28
      failed_allocations = ['HR-LAL-2026-01824', 'HR-LAL-2026-01829', 'HR-LAL-2026-01830', 'HR-LAL-2026-01841', 'HR-LAL-2026-01842', 'HR-LAL-2026-01854', 'HR-LAL-2026-01858', 'HR-LAL-2026-01865', 'HR-LAL-2026-01887', 'HR-LAL-2026-01888', 'HR-LAL-2026-01889', 'HR-LAL-2026-01890', 'HR-LAL-2026-01894', 'HR-LAL-2026-01802', 'HR-LAL-2026-01806', 'HR-LAL-2026-01807', 'HR-LAL-2026-01809', 'HR-LAL-2026-01811', 'HR-LAL-2026-01814', 'HR-LAL-2026-01820', 'HR-LAL-2026-01833', 'HR-LAL-2026-01840', 'HR-LAL-2026-01855', 'HR-LAL-2026-01863', 'HR-LAL-2026-01864', 'HR-LAL-2026-01867', 'HR-LAL-2026-01868', 'HR-LAL-2026-01869', 'HR-LAL-2026-01870', 'HR-LAL-2026-01871', 'HR-LAL-2026-01873', 'HR-LAL-2026-01881', 'HR-LAL-2026-01883', 'HR-LAL-2026-01885', 'HR-LAL-2026-01893', 'HR-LAL-2026-01896', 'HR-LAL-2026-01899', 'HR-LAL-2026-01900', 'HR-LAL-2026-01901', 'HR-LAL-2026-01903', 'HR-LAL-2026-01904', 'HR-LAL-2026-01905', 'HR-LAL-2026-01907', 'HR-LAL-2026-01908', 'HR-LAL-2026-01911']
      e_leave_type = {'name': 'Normal Leave 22.5 Days', 'max_leaves_allowed': 22.5, 'earned_leave_frequency': 'Monthly', 'rounding': '0.25', 'allocate_on_day': 'Last Day'}
      leave_allocations = [frappe.types.frappedict._dict{'name': 'HR-LAL-2026-01797', 'employee': 'HR-EMP-00128', 'from_date': 2026-01-01, 'to_date': 2026-12-31, 'leave_policy_assignment': 'HR-LPOL-ASSGN-00186', 'leave_policy': 'HR-LPOL-2025-00001', 'earned_leave_schedule_exists': 12}, frappe.types.frappedict._dict{'name': 'HR-LAL-2026-01798', 'employee': 'HR-EMP-00127', 'from_date': 2026-01-01, 'to_date': 2026-12-31, 'leave_policy_assignment': 'HR-LPOL-ASSGN-00187', 'leave_policy': 'HR-LPOL-2025-00001', 'earned_leave_schedule_exists': 12}, frappe.types.frappedict._dict{'name': 'HR-LAL-2026-01799', 'employee': 'HR-EMP-00126', 'from_date': 2026-01-01, 'to_date': 2026-12-31, 'leave_policy_assignment': 'HR-LPOL-ASSGN...1', 'earned_leave_schedule_exists': 12}, frappe.types.frappedict._dict{'name': 'HR-LAL-2026-01912', 'employee': 'HR-EMP-00001', 'from_date': 2026-01-01, 'to_date': 2026-12-31, 'leave_policy_assignment': 'HR-LPOL-ASSGN-00301', 'leave_policy': 'HR-LPOL-2025-00001', 'earned_leave_schedule_exists': 12}]
      allocation = {'name': 'HR-LAL-2026-01912', 'employee': 'HR-EMP-00001', 'from_date': datetime.date(2026, 1, 1), 'to_date': datetime.date(2026, 12, 31), 'leave_policy_assignment': 'HR-LPOL-ASSGN-00301', 'leave_policy': 'HR-LPOL-2025-00001', 'earned_leave_schedule_exists': 12}
      allocation_date = 2026-02-28
      earned_leaves = 1.25
      annual_allocation = 15.0
      e = Allocation was skipped due to maximum leave allocation limit set in leave type. Please increase the limit and retry failed allocation.
  File "apps/hrms/hrms/hr/utils.py", line 429, in update_previous_leave_allocation
    frappe.throw(
      allocation = Leave Allocation (HR-LAL-2026-01912)
      annual_allocation = 15.0
      e_leave_type = {'name': 'Normal Leave 22.5 Days', 'max_leaves_allowed': 22.5, 'earned_leave_frequency': 'Monthly', 'rounding': '0.25', 'allocate_on_day': 'Last Day'}
      earned_leaves = 1.25
      today = 2026-02-28
      new_allocation = 23.75
      new_allocation_without_cf = 1.25
  File "apps/frappe/frappe/utils/messages.py", line 148, in throw
    msgprint(
      msg = 'Allocation was skipped due to maximum leave allocation limit set in leave type. Please increase the limit and retry failed allocation.'
      exc = hrms.hr.utils.OverAllocationError
      title = None
      is_minimizable = False
      wide = False
      as_list = False
      primary_action = None
  File "apps/frappe/frappe/utils/messages.py", line 109, in msgprint
    _raise_exception()
      msg = 'Allocation was skipped due to maximum leave allocation limit set in leave type. Please increase the limit and retry failed allocation.'
      title = None
      raise_exception = hrms.hr.utils.OverAllocationError
      as_table = False
      as_list = False
      indicator = 'red'
      alert = False
      primary_action = None
      is_minimizable = False
      wide = False
      realtime = False
      _raise_exception = <function msgprint.<locals>._raise_exception at 0x7fdb81a417a0>
      inspect = <module 'inspect' from '/usr/lib/python3.14/inspect.py'>
      out = {'message': 'Allocation was skipped due to maximum leave allocation limit set in leave type. Please increase the limit and retry failed allocation.', 'as_table': False, 'title': 'Message', 'indicator': 'red', 'raise_exception': 1, '__frappe_exc_id': '0cd3e83ac7636bbc08398590449e333d846d503b5f1db83e890378a1'}
  File "apps/frappe/frappe/utils/messages.py", line 58, in _raise_exception
    raise exc
      exc = Allocation was skipped due to maximum leave allocation limit set in leave type. Please increase the limit and retry failed allocation.
      inspect = <module 'inspect' from '/usr/lib/python3.14/inspect.py'>
      msg = 'Allocation was skipped due to maximum leave allocation limit set in leave type. Please increase the limit and retry failed allocation.'
      out = {'message': 'Allocation was skipped due to maximum leave allocation limit set in leave type. Please increase the limit and retry failed allocation.', 'as_table': False, 'title': 'Message', 'indicator': 'red', 'raise_exception': 1, '__frappe_exc_id': '0cd3e83ac7636bbc08398590449e333d846d503b5f1db83e890378a1'}
      raise_exception = hrms.hr.utils.OverAllocationError
hrms.hr.utils.OverAllocationError: Allocation was skipped due to maximum leave allocation limit set in leave type. Please increase the limit and retry failed allocation.

Code of Conduct

  • I agree to follow this project's Code of Conduct