fix: Validation
This commit is contained in:
parent
625acab057
commit
d29dd58e89
@ -14,13 +14,12 @@ from erpnext.stock.doctype.item.item import get_item_defaults
|
|||||||
class BlanketOrder(Document):
|
class BlanketOrder(Document):
|
||||||
def validate(self):
|
def validate(self):
|
||||||
self.validate_dates()
|
self.validate_dates()
|
||||||
|
self.validate_duplicate_items()
|
||||||
|
|
||||||
def validate_dates(self):
|
def validate_dates(self):
|
||||||
if getdate(self.from_date) > getdate(self.to_date):
|
if getdate(self.from_date) > getdate(self.to_date):
|
||||||
frappe.throw(_("From date cannot be greater than To date"))
|
frappe.throw(_("From date cannot be greater than To date"))
|
||||||
|
|
||||||
self.validate_duplicate_items()
|
|
||||||
|
|
||||||
def validate_duplicate_items(self):
|
def validate_duplicate_items(self):
|
||||||
item_list = []
|
item_list = []
|
||||||
for item in self.items:
|
for item in self.items:
|
||||||
|
Loading…
Reference in New Issue
Block a user