[minor] feature to restrict no of rows in report
This commit is contained in:
parent
1f3abe9a79
commit
658288cd18
2 changed files with 30 additions and 2 deletions
|
|
@ -143,6 +143,34 @@
|
|||
"set_only_once": 0,
|
||||
"unique": 0
|
||||
},
|
||||
{
|
||||
"allow_on_submit": 0,
|
||||
"bold": 0,
|
||||
"collapsible": 0,
|
||||
"columns": 0,
|
||||
"default": "100",
|
||||
"description": "Max 500",
|
||||
"fieldname": "no_of_rows",
|
||||
"fieldtype": "Int",
|
||||
"hidden": 0,
|
||||
"ignore_user_permissions": 0,
|
||||
"ignore_xss_filter": 0,
|
||||
"in_filter": 0,
|
||||
"in_list_view": 0,
|
||||
"label": "No of Rows",
|
||||
"length": 0,
|
||||
"no_copy": 0,
|
||||
"permlevel": 0,
|
||||
"precision": "",
|
||||
"print_hide": 0,
|
||||
"print_hide_if_no_value": 0,
|
||||
"read_only": 0,
|
||||
"report_hide": 0,
|
||||
"reqd": 0,
|
||||
"search_index": 0,
|
||||
"set_only_once": 0,
|
||||
"unique": 0
|
||||
},
|
||||
{
|
||||
"allow_on_submit": 0,
|
||||
"bold": 0,
|
||||
|
|
@ -445,7 +473,7 @@
|
|||
"issingle": 0,
|
||||
"istable": 0,
|
||||
"max_attachments": 0,
|
||||
"modified": "2016-09-15 01:32:57.454880",
|
||||
"modified": "2016-09-22 07:31:59.959051",
|
||||
"modified_by": "Administrator",
|
||||
"module": "Email",
|
||||
"name": "Auto Email Report",
|
||||
|
|
|
|||
|
|
@ -42,7 +42,7 @@ class AutoEmailReport(Document):
|
|||
def get_report_content(self):
|
||||
'''Returns file in for the report in given format'''
|
||||
report = frappe.get_doc('Report', self.report)
|
||||
raw = report.get_data(limit=500, user = self.user, filters = self.filters)
|
||||
raw = report.get_data(limit=self.no_of_rows or 100, user = self.user, filters = self.filters)
|
||||
|
||||
if self.format == 'HTML':
|
||||
return self.get_html_table(raw)
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue