show new reports as well as old

This commit is contained in:
Rushabh Mehta
2012-05-29 10:53:37 +05:30
parent e316795196
commit 16aea34a37
5 changed files with 57 additions and 11 deletions

View File

@@ -17,7 +17,7 @@
import webnotes
@webnotes.whitelist()
def get_report_list(arg=None):
def get_sc_list(arg=None):
"""return list of reports for the given module module"""
webnotes.response['values'] = webnotes.conn.sql("""select
distinct criteria_name, doc_type, parent_doc_type
@@ -26,4 +26,16 @@ def get_report_list(arg=None):
and docstatus in (0, NULL)
and ifnull(disabled, 0) = 0
order by criteria_name
limit %(limit_start)s, %(limit_page_length)s""" % webnotes.form_dict, as_dict=True)
@webnotes.whitelist()
def get_report_list():
"""return list on new style reports for modules"""
webnotes.response['values'] = webnotes.conn.sql("""select
distinct tabReport.name, tabReport.ref_doctype
from `tabReport`, `tabDocType`
where tabDocType.module='%(module)s'
and tabDocType.name = tabReport.ref_doctype
and tabReport.docstatus in (0, NULL)
order by tabReport.name
limit %(limit_start)s, %(limit_page_length)s""" % webnotes.form_dict, as_dict=True)