Quellcode durchsuchen

Error handling if visible_index not found in query report (#3399)

version-14
Manas Solanki vor 8 Jahren
committed by Nabin Hait
Ursprung
Commit
ecfd190044
1 geänderte Dateien mit 4 neuen und 1 gelöschten Zeilen
  1. +4
    -1
      frappe/desk/query_report.py

+ 4
- 1
frappe/desk/query_report.py Datei anzeigen

@@ -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")


Laden…
Abbrechen
Speichern