fix: to date cannot be less than from date validation on student leave application
diff --git a/erpnext/education/doctype/student_leave_application/student_leave_application.py b/erpnext/education/doctype/student_leave_application/student_leave_application.py
index b3e71a2..410f0cc 100644
--- a/erpnext/education/doctype/student_leave_application/student_leave_application.py
+++ b/erpnext/education/doctype/student_leave_application/student_leave_application.py
@@ -7,9 +7,11 @@
from frappe import _
from frappe.utils import get_link_to_form
from frappe.model.document import Document
+from frappe import throw, _
class StudentLeaveApplication(Document):
def validate(self):
+ self.validate_dates()
self.validate_duplicate()
def validate_duplicate(self):
@@ -29,4 +31,8 @@
if data:
link = get_link_to_form("Student Leave Application", data[0].name)
frappe.throw(_("Leave application {0} already exists against the student {1}")
- .format(link, self.student))
\ No newline at end of file
+ .format(link, self.student))
+
+ def validate_dates(self):
+ if self.to_date < self.from_date :
+ throw(_("To Date cannot be less than From Date"))
\ No newline at end of file