Procházet zdrojové kódy

validate criteria name

version-14
Rushabh Mehta před 14 roky
rodič
revize
ca6e0771a9
1 změnil soubory, kde provedl 2 přidání a 1 odebrání
  1. +2
    -1
      cgi-bin/core/doctype/search_criteria/search_criteria.py

+ 2
- 1
cgi-bin/core/doctype/search_criteria/search_criteria.py Zobrazit soubor

@@ -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()


Načítá se…
Zrušit
Uložit