From 302bce355f8eadf1d1f2cfe4d68719a7a532c7bd Mon Sep 17 00:00:00 2001 From: abhijitkumbharIND Date: Fri, 31 May 2019 12:17:17 +0530 Subject: [PATCH 1/2] fix: Vehicle Master - Last carbon check accepting future date.(#17821) --- erpnext/hr/doctype/vehicle/vehicle.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/erpnext/hr/doctype/vehicle/vehicle.py b/erpnext/hr/doctype/vehicle/vehicle.py index ef5bfe53cd..50c3727473 100644 --- a/erpnext/hr/doctype/vehicle/vehicle.py +++ b/erpnext/hr/doctype/vehicle/vehicle.py @@ -5,10 +5,12 @@ from __future__ import unicode_literals import frappe from frappe import _ -from frappe.utils import getdate +from frappe.utils import getdate, nowdate from frappe.model.document import Document class Vehicle(Document): def validate(self): if getdate(self.start_date) > getdate(self.end_date): - frappe.throw(_("Insurance Start date should be less than Insurance End date")) \ No newline at end of file + frappe.throw(_("Insurance Start date should be less than Insurance End date")) + if getdate(self.carbon_check_date) > getdate(nowdate()): + frappe.throw(_("Last carbon check date cannot be a future date")) \ No newline at end of file From 39d6cf38fccf5b407cfcb4870e9714d327e0f5d3 Mon Sep 17 00:00:00 2001 From: abhijitkumbharIND Date: Fri, 31 May 2019 14:18:40 +0530 Subject: [PATCH 2/2] fix: Vehicle Master - Last carbon check accepting future date.(#17821) --- erpnext/hr/doctype/vehicle/vehicle.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/erpnext/hr/doctype/vehicle/vehicle.py b/erpnext/hr/doctype/vehicle/vehicle.py index 50c3727473..a75cfa6125 100644 --- a/erpnext/hr/doctype/vehicle/vehicle.py +++ b/erpnext/hr/doctype/vehicle/vehicle.py @@ -5,12 +5,12 @@ from __future__ import unicode_literals import frappe from frappe import _ -from frappe.utils import getdate, nowdate +from frappe.utils import getdate from frappe.model.document import Document class Vehicle(Document): def validate(self): if getdate(self.start_date) > getdate(self.end_date): frappe.throw(_("Insurance Start date should be less than Insurance End date")) - if getdate(self.carbon_check_date) > getdate(nowdate()): + if getdate(self.carbon_check_date) > getdate(): frappe.throw(_("Last carbon check date cannot be a future date")) \ No newline at end of file