removed validation for root node in territory, codacy recommended changed

This commit is contained in:
Abhishek Balam
2020-05-09 22:35:28 +05:30
parent b59f2780eb
commit 7cbc902d90
3 changed files with 3 additions and 5 deletions

View File

@@ -12,8 +12,6 @@ class Territory(NestedSet):
nsm_parent_field = 'parent_territory'
def validate(self):
if frappe.db.sql("SELECT COUNT(name) FROM `tabTerritory` WHERE parent IS NULL")[0][0] > 1:
frappe.throw('Only one Root Territory is allowed, please select a Parent Territory!')
for d in self.get('targets') or []:
if not flt(d.target_qty) and not flt(d.target_amount):