From 1118ee07a8f56337cce2dd2ca892f204a54b8028 Mon Sep 17 00:00:00 2001 From: indictrans Date: Sat, 15 Feb 2020 17:37:39 +0530 Subject: [PATCH] fix:Future date of birth accepted at Sibling Detail section in Student form #20619 --- erpnext/education/doctype/student/student.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/erpnext/education/doctype/student/student.py b/erpnext/education/doctype/student/student.py index 99c4c0e908..d7d35ca122 100644 --- a/erpnext/education/doctype/student/student.py +++ b/erpnext/education/doctype/student/student.py @@ -22,6 +22,10 @@ class Student(Document): self.update_student_name_in_linked_doctype() def validate_dates(self): + for sibling in self.siblings: + if sibling.date_of_birth and getdate(sibling.date_of_birth) >= getdate(today()): + frappe.throw(_("Sibling Date of Birth cannot be greater than today at row #{0} ").format(sibling.idx)) + if self.date_of_birth and getdate(self.date_of_birth) >= getdate(today()): frappe.throw(_("Date of Birth cannot be greater than today."))