From e1ed9f97e1346abfd6f7331141e27d17241289ad Mon Sep 17 00:00:00 2001 From: Ankush Menat Date: Thu, 4 Nov 2021 11:23:39 +0530 Subject: [PATCH] chore: extend fix and cleanup whitespace --- erpnext/stock/doctype/item_price/item_price.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/erpnext/stock/doctype/item_price/item_price.py b/erpnext/stock/doctype/item_price/item_price.py index d340e3cabe82..197b147e7eed 100644 --- a/erpnext/stock/doctype/item_price/item_price.py +++ b/erpnext/stock/doctype/item_price/item_price.py @@ -6,6 +6,7 @@ import frappe from frappe import _ from frappe.model.document import Document +from frappe.utils import getdate class ItemPriceDuplicateItem(frappe.ValidationError): @@ -26,10 +27,8 @@ def validate_item(self): frappe.throw(_("Item {0} not found.").format(self.item_code)) def validate_dates(self): - from frappe.utils import getdate - if self.valid_from and self.valid_upto: - if self.valid_from > getdate(self.valid_upto): + if getdate(self.valid_from) > getdate(self.valid_upto): frappe.throw(_("Valid From Date must be lesser than Valid Upto Date.")) def update_price_list_details(self):