Parcourir la source

Fix: Search Field customization via customize form view

version-14
Anand Doshi il y a 13 ans
Parent
révision
fe08e9c20e
1 fichiers modifiés avec 6 ajouts et 2 suppressions
  1. +6
    -2
      py/webnotes/widgets/search.py

+ 6
- 2
py/webnotes/widgets/search.py Voir le fichier

@@ -3,8 +3,12 @@ import webnotes


# this is called when a new doctype is setup for search - to set the filters # this is called when a new doctype is setup for search - to set the filters
def getsearchfields(): 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 = sf and sf[0][0] or ''
sf = [s.strip() for s in sf.split(',')] sf = [s.strip() for s in sf.split(',')]
if sf and sf[0]: if sf and sf[0]:


Chargement…
Annuler
Enregistrer