From 2ff298c5879383afc2e5a39f42f0034d2f9e9d40 Mon Sep 17 00:00:00 2001 From: Aditya Hase Date: Thu, 30 May 2019 17:47:54 +0530 Subject: [PATCH] fix(query-report): Adding custom column data when result row is a tuple Result row can be a list, dict or a tuple. Previously handled cases: Case dict: row can be used as it is Case list: row is converted to an equivalent dict Unhandled case (fixed with this commit): Case tuple: row is converted to a list so that it can be handled with the list case --- frappe/desk/query_report.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/frappe/desk/query_report.py b/frappe/desk/query_report.py index 0890e2ad7a..239cbdc642 100644 --- a/frappe/desk/query_report.py +++ b/frappe/desk/query_report.py @@ -209,6 +209,9 @@ def add_data_to_custom_columns(columns, result): data = [] for row in result: row_obj = {} + if isinstance(row, tuple): + row = list(row) + if isinstance(row, list): for idx, column in enumerate(columns): if column.get('link_field'):