浏览代码

fix in IN filter of reportview

version-14
Anand Doshi 12 年前
父节点
当前提交
be7db9ec3b
共有 1 个文件被更改,包括 2 次插入1 次删除
  1. +2
    -1
      webnotes/widgets/reportview.py

+ 2
- 1
webnotes/widgets/reportview.py 查看文件

@@ -176,6 +176,7 @@ def build_filter_conditions(data, filters, conditions):
if f[2]=='in': if f[2]=='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])
else: else:
if isinstance(f[3], basestring): if isinstance(f[3], basestring):
f[3] = "'" + f[3].replace("'", "\'") + "'" f[3] = "'" + f[3].replace("'", "\'") + "'"
@@ -183,7 +184,7 @@ def build_filter_conditions(data, filters, conditions):
else: else:
conditions.append('ifnull(' + tname + '.' + f[1] + ",0) " + f[2] \ conditions.append('ifnull(' + tname + '.' + f[1] + ",0) " + f[2] \
+ " " + cstr(f[3])) + " " + cstr(f[3]))
def build_match_conditions(data, conditions): def build_match_conditions(data, conditions):
"""add match conditions if applicable""" """add match conditions if applicable"""
match_conditions = [] match_conditions = []


正在加载...
取消
保存