From 64187bb451d57384100c5e8e206524e7b59bab21 Mon Sep 17 00:00:00 2001 From: deepeshgarg007 Date: Tue, 16 Apr 2019 12:53:37 +0530 Subject: [PATCH] fix: Custom columns handling for prepared report --- frappe/core/doctype/prepared_report/prepared_report.py | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/frappe/core/doctype/prepared_report/prepared_report.py b/frappe/core/doctype/prepared_report/prepared_report.py index 1cd106dabd..5217a6537d 100644 --- a/frappe/core/doctype/prepared_report/prepared_report.py +++ b/frappe/core/doctype/prepared_report/prepared_report.py @@ -37,6 +37,15 @@ class PreparedReport(Document): def run_background(instance): report = frappe.get_doc("Report", instance.ref_report_doctype) + + report.custom_columns = [] + + if report.report_type == 'Custom Report': + custom_report_doc = report + reference_report = custom_report_doc.reference_report + report = frappe.get_doc("Report", reference_report) + report.custom_columns = custom_report_doc.json + result = generate_report_result(report, filters=instance.filters, user=instance.owner) create_json_gz_file(result['result'], 'Prepared Report', instance.name)