From 20f0ef2515446ce14c0ba754c58208e25d9c1030 Mon Sep 17 00:00:00 2001 From: Neil Trini Lasrado Date: Mon, 6 Apr 2015 15:07:31 +0530 Subject: [PATCH] validation added - dob cannot accept a future date --- erpnext/hr/doctype/employee/employee.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/erpnext/hr/doctype/employee/employee.py b/erpnext/hr/doctype/employee/employee.py index 5a9bad29dc..5e857f82f3 100644 --- a/erpnext/hr/doctype/employee/employee.py +++ b/erpnext/hr/doctype/employee/employee.py @@ -97,6 +97,9 @@ class Employee(Document): user.save() def validate_date(self): + if self.date_of_birth and getdate(self.date_of_birth) > getdate(today()): + throw(_("Date of Birth cannot be greater than today.")) + if self.date_of_birth and self.date_of_joining and getdate(self.date_of_birth) >= getdate(self.date_of_joining): throw(_("Date of Joining must be greater than Date of Birth"))