validate criteria name
This commit is contained in:
parent
923a1e5447
commit
ca6e0771a9
1 changed files with 2 additions and 1 deletions
|
|
@ -27,7 +27,8 @@ class DocType:
|
|||
webnotes.conn.set(self.doc,'module',doctype_module and doctype_module[0][0] or 'NULL')
|
||||
|
||||
def validate(self):
|
||||
sql("select name from `tabSearch Criteria` where criteria_name=%s and name!=%s", (self.doc.criteria_name, self.doc.name))
|
||||
if sql("select name from `tabSearch Criteria` where criteria_name=%s and name!=%s", (self.doc.criteria_name, self.doc.name)):
|
||||
webnots.msgprint("Criteria Name '%s' already used, please use another name" % self.doc.criteria_name, raise_exception = 1)
|
||||
|
||||
def on_update(self):
|
||||
self.set_module()
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue