Browse Source

Merge branch 'develop'

version-14
Pratik Vyas 11 years ago
parent
commit
3c1e69c798
3 changed files with 11 additions and 13 deletions
  1. +1
    -1
      config.json
  2. +1
    -1
      requirements.txt
  3. +9
    -11
      webnotes/widgets/reportview.py

+ 1
- 1
config.json View File

@@ -1,6 +1,6 @@
{ {
"base_template": "lib/website/templates/base.html", "base_template": "lib/website/templates/base.html",
"framework_version": "3.4.3",
"framework_version": "3.4.4",
"modules": { "modules": {
"Calendar": { "Calendar": {
"color": "#2980b9", "color": "#2980b9",


+ 1
- 1
requirements.txt View File

@@ -7,7 +7,7 @@ httplib2
jinja2 jinja2
markdown2 markdown2
markupsafe markupsafe
mysql-python
mysql-python==1.2.4
pygeoip pygeoip
python-dateutil python-dateutil
python-memcached python-memcached


+ 9
- 11
webnotes/widgets/reportview.py View File

@@ -184,20 +184,18 @@ def build_filter_conditions(filters, conditions):
f[3] = "(" + ', '.join(opts) + ")" f[3] = "(" + ', '.join(opts) + ")"
conditions.append('ifnull(' + tname + '.' + f[1] + ", '') " + f[2] + " " + f[3]) conditions.append('ifnull(' + tname + '.' + f[1] + ", '') " + f[2] + " " + f[3])
else: 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: 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( 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): def build_match_conditions(doctype, fields=None, as_condition=True):
"""add match conditions if applicable""" """add match conditions if applicable"""


Loading…
Cancel
Save