Kaynağa Gözat

changes to handle server side queries

version-14
Saurabh 12 yıl önce
ebeveyn
işleme
e487b1a37d
1 değiştirilmiş dosya ile 3 ekleme ve 1 silme
  1. +3
    -1
      webnotes/widgets/reportview.py

+ 3
- 1
webnotes/widgets/reportview.py Dosyayı Görüntüle

@@ -172,6 +172,8 @@ def build_conditions(doctype, fields, filters, docstatus):
def build_filter_conditions(filters, conditions): def build_filter_conditions(filters, conditions):
"""build conditions from user filters""" """build conditions from user filters"""
from webnotes.utils import cstr from webnotes.utils import cstr
global tables
if not tables: tables = []
for f in filters: for f in filters:
tname = ('`tab' + f[0] + '`') tname = ('`tab' + f[0] + '`')
@@ -179,7 +181,7 @@ def build_filter_conditions(filters, conditions):
tables.append(tname) tables.append(tname)
# prepare in condition # prepare in condition
if f[2]=='in':
if f[2] in ['in', 'not in']:
opts = ["'" + t.strip().replace("'", "\\'") + "'" for t in f[3].split(',')] opts = ["'" + t.strip().replace("'", "\\'") + "'" for t in f[3].split(',')]
f[3] = "(" + ', '.join(opts) + ")" f[3] = "(" + ', '.join(opts) + ")"
conditions.append(tname + '.' + f[1] + " " + f[2] + " " + f[3]) conditions.append(tname + '.' + f[1] + " " + f[2] + " " + f[3])


Yükleniyor…
İptal
Kaydet