Parent node validation fixed for tree
This commit is contained in:
parent
c84c86e458
commit
f24d2efe2c
@ -52,7 +52,7 @@ class DocType:
|
||||
|
||||
def validate(self):
|
||||
if self.doc.lft and self.doc.rgt:
|
||||
res = sql("select name from `tabItem Group` where is_group = 'Yes' and docstatus!= 2 and (rgt > %s or lft < %s) and name ='%s' and name !='%s'"%(self.doc.rgt,self.doc.lft,self.doc.parent_item_group,self.doc.item_group_name))
|
||||
res = sql("select name from `tabItem Group` where is_group = 'Yes' and docstatus!= 2 and name ='%s' and name !='%s'"%(self.doc.parent_item_group,self.doc.item_group_name))
|
||||
if not res:
|
||||
msgprint("Please enter proper parent item group.")
|
||||
raise Exception
|
||||
|
@ -61,7 +61,7 @@ class DocType:
|
||||
|
||||
def validate(self):
|
||||
if self.doc.lft and self.doc.rgt:
|
||||
res = sql("select name from `tabTerritory` where is_group = 'Yes' and docstatus!= 2 and (rgt > %s or lft < %s) and name ='%s' and name !='%s'"%(self.doc.rgt,self.doc.lft,self.doc.parent_territory,self.doc.territory_name))
|
||||
res = sql("select name from `tabTerritory` where is_group = 'Yes' and docstatus!= 2 and name ='%s' and name !='%s'"%(self.doc.parent_territory,self.doc.territory_name))
|
||||
if not res:
|
||||
msgprint("Please enter proper parent territory.")
|
||||
raise Exception
|
||||
|
Loading…
x
Reference in New Issue
Block a user