From fe08e9c20e72bf2935b512e5643e92b3a8545fe7 Mon Sep 17 00:00:00 2001 From: Anand Doshi Date: Mon, 30 Jan 2012 11:54:13 +0530 Subject: [PATCH] Fix: Search Field customization via customize form view --- py/webnotes/widgets/search.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/py/webnotes/widgets/search.py b/py/webnotes/widgets/search.py index bfd1c08486..5b1e4f6d7e 100644 --- a/py/webnotes/widgets/search.py +++ b/py/webnotes/widgets/search.py @@ -3,8 +3,12 @@ import webnotes # this is called when a new doctype is setup for search - to set the filters def getsearchfields(): - - sf = webnotes.conn.sql("select search_fields from tabDocType where name=%s", webnotes.form.getvalue("doctype")) + sf = webnotes.conn.sql("""\ + SELECT value FROM `tabProperty Setter` + WHERE doc_type=%s AND doc_name=%s AND property='search_fields'""", \ + (webnotes.form.getvalue("doctype"), webnotes.form.getvalue("doctype"))) + if not (sf and len(sf)>0 and sf[0][0]): + sf = webnotes.conn.sql("select search_fields from tabDocType where name=%s", webnotes.form.getvalue("doctype")) sf = sf and sf[0][0] or '' sf = [s.strip() for s in sf.split(',')] if sf and sf[0]: