Merge pull request #6673 from KanchanChauhan/max-leave-days-in-leave-application-hotfix

[Fix] leave application days should be less than max days leave allowed
This commit is contained in:
Nabin Hait 2016-10-24 11:18:44 +05:30 committed by GitHub
commit 5ced4dfe34

View File

@ -193,7 +193,7 @@ class LeaveApplication(Document):
def validate_max_days(self):
max_days = frappe.db.get_value("Leave Type", self.leave_type, "max_days_allowed")
if max_days and self.total_leave_days > max_days:
if max_days and self.total_leave_days > cint(max_days):
frappe.throw(_("Leave of type {0} cannot be longer than {1}").format(self.leave_type, max_days))
def validate_leave_approver(self):