ERPNext Foundation ERPNext Cloud Chat Blog Discuss Frappé* Donate

Query Report with Empty Filter


I am trying to create a report which by default has no value, and will only affect the report if it has some Value.

Traceback (most recent call last):
  File "/home/mohd/frappe-bench/apps/frappe/frappe/", line 56, in application
    response = frappe.handler.handle()
  File "/home/mohd/frappe-bench/apps/frappe/frappe/", line 21, in handle
    data = execute_cmd(cmd)
  File "/home/mohd/frappe-bench/apps/frappe/frappe/", line 52, in execute_cmd
    return, **frappe.form_dict)
  File "/home/mohd/frappe-bench/apps/frappe/frappe/", line 913, in call
    return fn(*args, **newargs)
  File "/home/mohd/frappe-bench/apps/frappe/frappe/desk/", line 89, in run
    result = [list(t) for t in frappe.db.sql(report.query, filters)]
  File "/home/mohd/frappe-bench/apps/frappe/frappe/", line 142, in sql
    self._cursor.execute(query, values)
  File "/home/mohd/frappe-bench/env/local/lib/python2.7/site-packages/MySQLdb/", line 238, in execute
    query = query % args
KeyError: 'user'

SQL Code:

AND (%(user)s IS NULL OR = %(user)s)

JS Code:
> {

              "label": __("User"),
              "fieldtype": "Link",
              "options": "User"

Can anybody help me out with showing the entire data if no filter is selected?



Is this still alive?


Even I want to know the same. i.e. when no filter is selected all records are fetched