fix: Validation

This commit is contained in:
Deepesh Garg 2020-04-02 21:29:59 +05:30
parent 625acab057
commit d29dd58e89

View File

@ -14,13 +14,12 @@ from erpnext.stock.doctype.item.item import get_item_defaults
class BlanketOrder(Document):
def validate(self):
self.validate_dates()
self.validate_duplicate_items()
def validate_dates(self):
if getdate(self.from_date) > getdate(self.to_date):
frappe.throw(_("From date cannot be greater than To date"))
self.validate_duplicate_items()
def validate_duplicate_items(self):
item_list = []
for item in self.items: