From e487b1a37d82cbe0aa72c235fafa751eb15f195e Mon Sep 17 00:00:00 2001 From: Saurabh Date: Tue, 9 Jul 2013 10:10:43 +0530 Subject: [PATCH] changes to handle server side queries --- webnotes/widgets/reportview.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/webnotes/widgets/reportview.py b/webnotes/widgets/reportview.py index 8b35e0d6b0..e99d6d3972 100644 --- a/webnotes/widgets/reportview.py +++ b/webnotes/widgets/reportview.py @@ -172,6 +172,8 @@ def build_conditions(doctype, fields, filters, docstatus): def build_filter_conditions(filters, conditions): """build conditions from user filters""" from webnotes.utils import cstr + global tables + if not tables: tables = [] for f in filters: tname = ('`tab' + f[0] + '`') @@ -179,7 +181,7 @@ def build_filter_conditions(filters, conditions): tables.append(tname) # prepare in condition - if f[2]=='in': + if f[2] in ['in', 'not in']: opts = ["'" + t.strip().replace("'", "\\'") + "'" for t in f[3].split(',')] f[3] = "(" + ', '.join(opts) + ")" conditions.append(tname + '.' + f[1] + " " + f[2] + " " + f[3])