mirror of
https://github.com/frappe/erpnext.git
synced 2026-05-22 22:49:19 +00:00
fix: Vehicle Master - Last carbon check accepting future date.(#17821)
This commit is contained in:
@@ -5,12 +5,12 @@
|
|||||||
from __future__ import unicode_literals
|
from __future__ import unicode_literals
|
||||||
import frappe
|
import frappe
|
||||||
from frappe import _
|
from frappe import _
|
||||||
from frappe.utils import getdate, nowdate
|
from frappe.utils import getdate
|
||||||
from frappe.model.document import Document
|
from frappe.model.document import Document
|
||||||
|
|
||||||
class Vehicle(Document):
|
class Vehicle(Document):
|
||||||
def validate(self):
|
def validate(self):
|
||||||
if getdate(self.start_date) > getdate(self.end_date):
|
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(nowdate()):
|
if getdate(self.carbon_check_date) > getdate():
|
||||||
frappe.throw(_("Last carbon check date cannot be a future date"))
|
frappe.throw(_("Last carbon check date cannot be a future date"))
|
||||||
Reference in New Issue
Block a user