Skip to content

Commit

Permalink
fix: let administrator approve leaves irrespective of self approval s…
Browse files Browse the repository at this point in the history
…etting
  • Loading branch information
asmitahase committed Jan 30, 2025
1 parent 7653c51 commit 654d55b
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions hrms/hr/doctype/leave_application/leave_application.py
Original file line number Diff line number Diff line change
Expand Up @@ -798,11 +798,13 @@ def create_ledger_entry_for_intermediate_allocation_expiry(self, expiry_date, su

def validate_for_self_approval(self):
self_leave_approval_allowed = frappe.db.get_single_value("HR Settings", "allow_self_leave_approval")

if (not self_leave_approval_allowed) and (
self.employee == get_current_employee_info()["name"]
and not get_workflow_name("Leave Application")
self.employee == get_current_employee_info().get("name")
if get_current_employee_info()
else None and not get_workflow_name("Leave Application")
):
frappe.throw(_("Self approval for leaves is not allowed"), frappe.ValidationError)
frappe.throw(_("Self-approval for leaves is not allowed"), frappe.ValidationError)


def get_allocation_expiry_for_cf_leaves(
Expand Down

0 comments on commit 654d55b

Please sign in to comment.