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])