From 37fe72e4e96229df8c7678df1f8d13150635a5f1 Mon Sep 17 00:00:00 2001 From: Nabin Hait Date: Mon, 12 Aug 2013 15:29:50 +0530 Subject: [PATCH] [fix] [minor] Do not validate leave balance if status is Rejected --- hr/doctype/leave_application/leave_application.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/hr/doctype/leave_application/leave_application.py b/hr/doctype/leave_application/leave_application.py index 14c8b1f212..8a2df1e9c4 100755 --- a/hr/doctype/leave_application/leave_application.py +++ b/hr/doctype/leave_application/leave_application.py @@ -115,7 +115,8 @@ class DocType(DocListController): self.doc.leave_balance = get_leave_balance(self.doc.employee, self.doc.leave_type, self.doc.fiscal_year)["leave_balance"] - if self.doc.leave_balance - self.doc.total_leave_days < 0: + if self.doc.status != "Rejected" \ + and self.doc.leave_balance - self.doc.total_leave_days < 0: #check if this leave type allow the remaining balance to be in negative. If yes then warn the user and continue to save else warn the user and don't save. msgprint("There is not enough leave balance for Leave Type: %s" % \ (self.doc.leave_type,),