brotherton-erpnext/erpnext/patches/old_patches/rename_search_criteria.py

10 lines
307 B
Python
Raw Normal View History

2012-01-13 11:14:29 +05:30
import webnotes
from webnotes.model.code import get_obj
def execute():
for sc in webnotes.conn.sql("""select name from `tabSearch Criteria` where ifnull(name,'')
like 'srch%' or ifnull(name,'') like '%stdsrch'"""):
try:
get_obj('Search Criteria', sc[0]).rename()
except AttributeError, e:
pass