Skip to content

Commit

Permalink
chore: extend fix and cleanup whitespace
Browse files Browse the repository at this point in the history
  • Loading branch information
ankush committed Nov 4, 2021
1 parent e22b8ef commit e1ed9f9
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions erpnext/stock/doctype/item_price/item_price.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
import frappe
from frappe import _
from frappe.model.document import Document
from frappe.utils import getdate


class ItemPriceDuplicateItem(frappe.ValidationError):
Expand All @@ -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):
Expand Down

0 comments on commit e1ed9f9

Please sign in to comment.