Error handling if visible_index not found in query report (#3399)
This commit is contained in:
parent
4f80f7633f
commit
ecfd190044
1 changed files with 4 additions and 1 deletions
|
|
@ -129,6 +129,8 @@ def export_query():
|
|||
file_format_type = data["file_format_type"]
|
||||
if isinstance(data.get("visible_idx"), basestring):
|
||||
visible_idx = json.loads(data.get("visible_idx"))
|
||||
else:
|
||||
visible_idx = None
|
||||
|
||||
if file_format_type == "Excel":
|
||||
|
||||
|
|
@ -154,7 +156,8 @@ def export_query():
|
|||
result = result + data.result
|
||||
|
||||
# filter rows by slickgrid's inline filter
|
||||
result = [x for idx, x in enumerate(result) if idx == 0 or idx in visible_idx]
|
||||
if visible_idx:
|
||||
result = [x for idx, x in enumerate(result) if idx == 0 or idx in visible_idx]
|
||||
|
||||
from frappe.utils.xlsxutils import make_xlsx
|
||||
xlsx_file = make_xlsx(result, "Query Report")
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue