fix: simplify insufficient leave balance message
diff --git a/erpnext/hr/doctype/leave_application/leave_application.py b/erpnext/hr/doctype/leave_application/leave_application.py
index 040803d..86c0d0d 100755
--- a/erpnext/hr/doctype/leave_application/leave_application.py
+++ b/erpnext/hr/doctype/leave_application/leave_application.py
@@ -295,12 +295,7 @@
if leave_balance_for_consumption != self.leave_balance:
msg = _("Warning: Insufficient leave balance for Leave Type {0} in this allocation.").format(frappe.bold(self.leave_type))
msg += "<br><br>"
- msg += _("Actual leave balance is {0} but only {1} leave(s) can be consumed between {2} (Application Date) and {3} (Allocation Expiry).").format(
- frappe.bold(self.leave_balance), frappe.bold(leave_balance_for_consumption),
- frappe.bold(formatdate(self.from_date)),
- frappe.bold(formatdate(alloc_on_from_date.to_date)))
- msg += "<br>"
- msg += _("Remaining leaves would be compensated in the next allocation.")
+ msg += _("Actual balances aren't available because the leave application spans over different leave allocations. You can still apply for leaves which would be compensated during the next allocation.")
else:
msg = _("Warning: Insufficient leave balance for Leave Type {0}.").format(frappe.bold(self.leave_type))
diff --git a/erpnext/hr/report/employee_leave_balance/employee_leave_balance.py b/erpnext/hr/report/employee_leave_balance/employee_leave_balance.py
index 3324ede..66c1d25 100644
--- a/erpnext/hr/report/employee_leave_balance/employee_leave_balance.py
+++ b/erpnext/hr/report/employee_leave_balance/employee_leave_balance.py
@@ -3,7 +3,7 @@
from itertools import groupby
-from typing import Dict, List, Tuple
+from typing import Dict, List, Optional, Tuple
import frappe
from frappe import _
@@ -17,7 +17,7 @@
Filters = frappe._dict
-def execute(filters: Filters = None) -> Tuple:
+def execute(filters: Optional[Filters] = None) -> Tuple:
if filters.to_date <= filters.from_date:
frappe.throw(_('"From Date" can not be greater than or equal to "To Date"'))
@@ -162,7 +162,7 @@
return conditions
-def get_department_leave_approver_map(department: str = None):
+def get_department_leave_approver_map(department: Optional[str] = None):
# get current department and all its child
department_list = frappe.get_list('Department',
filters={'disabled': 0},