From fc6d904c9a0525172dfc39bfe1013aa132c1d51a Mon Sep 17 00:00:00 2001 From: Nabin Hait Date: Mon, 6 Jan 2014 16:29:01 +0530 Subject: [PATCH 1/3] Fixes in reportview filter conditions --- webnotes/widgets/reportview.py | 20 +++++++++----------- 1 file changed, 9 insertions(+), 11 deletions(-) diff --git a/webnotes/widgets/reportview.py b/webnotes/widgets/reportview.py index 656d2fa21d..62ef887817 100644 --- a/webnotes/widgets/reportview.py +++ b/webnotes/widgets/reportview.py @@ -184,20 +184,18 @@ def build_filter_conditions(filters, conditions): f[3] = "(" + ', '.join(opts) + ")" conditions.append('ifnull(' + tname + '.' + f[1] + ", '') " + f[2] + " " + f[3]) else: - if isinstance(f[3], basestring): - df = webnotes.local.reportview_doctypes[f[0]].get({"doctype": "DocField", - "fieldname": f[1]}) + df = webnotes.local.reportview_doctypes[f[0]].get({"doctype": "DocField", + "fieldname": f[1]}) - if df and df[0].fieldtype in ["Float", "Int", "Currency", "Percent"]: - val, default_null_val = flt(f[3]), "0" - else: - val, default_null_val = ("'" + f[3].replace("'", "\\'") + "'"), '""' + if f[2] == "like" or (isinstance(f[3], basestring) and + (not df or df[0].fieldtype not in ["Float", "Int", "Currency", "Percent"])): + value, default_val = ("'" + f[3].replace("'", "\\'") + "'"), '""' else: - val, default_null_val = f[3], '0' - + value, default_val = flt(f[3]), 0 + conditions.append('ifnull({tname}.{fname}, {default_val}) {operator} {value}'.format( - tname=tname, fname=f[1], default_val=default_null_val, operator=f[2], - value=cstr(val))) + tname=tname, fname=f[1], default_val=default_val, operator=f[2], + value=value)) def build_match_conditions(doctype, fields=None, as_condition=True): """add match conditions if applicable""" From 87fa6bee40ed9c61d2fd5ed413d9b4fa01a4b390 Mon Sep 17 00:00:00 2001 From: Pratik Vyas Date: Tue, 7 Jan 2014 12:00:30 +0530 Subject: [PATCH 2/3] pin mysql-python to 1.2.4 --- requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements.txt b/requirements.txt index 075ba9cfe7..961a673fb0 100644 --- a/requirements.txt +++ b/requirements.txt @@ -7,7 +7,7 @@ httplib2 jinja2 markdown2 markupsafe -mysql-python +mysql-python==1.2.4 pygeoip python-dateutil python-memcached From da0b73da667ef5b6d9c6f28dac6ec92b2b28bfd2 Mon Sep 17 00:00:00 2001 From: Pratik Vyas Date: Tue, 7 Jan 2014 14:17:39 +0600 Subject: [PATCH 3/3] bumped to version 3.4.4 --- config.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config.json b/config.json index a36e2aada9..060c9d8a33 100644 --- a/config.json +++ b/config.json @@ -1,6 +1,6 @@ { "base_template": "lib/website/templates/base.html", - "framework_version": "3.4.3", + "framework_version": "3.4.4", "modules": { "Calendar": { "color": "#2980b9",