[Fix] leave application days should be less than max days leave allowed

This commit is contained in:
Kanchan Chauhan 2016-10-21 13:01:33 +05:30
parent d5e52bc251
commit 24d580206a

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):