From e329d417d66d6b1698d71ff9e3b58a435e6d24ba Mon Sep 17 00:00:00 2001 From: shrikant dixit Date: Sat, 15 Feb 2020 18:20:05 +0530 Subject: [PATCH] fix: Added validation for student DOB can not be greater than Joining Date --- erpnext/education/doctype/student/student.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/erpnext/education/doctype/student/student.py b/erpnext/education/doctype/student/student.py index 99c4c0e908..ae8f3a2e54 100644 --- a/erpnext/education/doctype/student/student.py +++ b/erpnext/education/doctype/student/student.py @@ -25,6 +25,9 @@ class Student(Document): if self.date_of_birth and getdate(self.date_of_birth) >= getdate(today()): frappe.throw(_("Date of Birth cannot be greater than today.")) + if self.date_of_birth and getdate(self.date_of_birth) >= getdate(self.joining_date): + frappe.throw(_("Date of Birth cannot be greater than Joining Date.")) + if self.joining_date and self.date_of_leaving and getdate(self.joining_date) > getdate(self.date_of_leaving): frappe.throw(_("Joining Date can not be greater than Leaving Date"))