Merge pull request #17823 from abhijitkumbharInd/develop

fix: Vehicle Master - Last carbon check accepting future date.(#17821)
This commit is contained in:
Saurabh 2019-05-31 14:26:08 +05:30 committed by GitHub
commit 011fe48ec3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -11,4 +11,6 @@ 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"))
frappe.throw(_("Insurance Start date should be less than Insurance End date"))
if getdate(self.carbon_check_date) > getdate():
frappe.throw(_("Last carbon check date cannot be a future date"))