Merge pull request #20623 from jprashant09/develop

fix: Future date of birth accepted at Sibling Detail section in Studen…
This commit is contained in:
Deepesh Garg 2020-02-24 18:30:27 +05:30 committed by GitHub
commit 735ec98b61
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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():
frappe.throw(_("Row {0}:Sibling Date of Birth cannot be greater than today.").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."))