From aca28018973ff9f10c176321516a76109673b548 Mon Sep 17 00:00:00 2001 From: Niraj Gautam Date: Wed, 23 Jul 2025 18:19:52 +0530 Subject: [PATCH] Parse html to text in export_query (#32794) * fix: Parse html to text in export_query * chore: Use xlsx data for csv content --- frappe/desk/query_report.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/frappe/desk/query_report.py b/frappe/desk/query_report.py index 00974c8169..2e17eccea5 100644 --- a/frappe/desk/query_report.py +++ b/frappe/desk/query_report.py @@ -356,7 +356,12 @@ def export_query(): ) if file_format_type == "CSV": - content = get_csv_bytes(xlsx_data, csv_params) + from frappe.utils.xlsxutils import handle_html + + content = get_csv_bytes( + [[handle_html(frappe.as_unicode(v)) if isinstance(v, str) else v for v in r] for r in xlsx_data], + csv_params, + ) file_extension = "csv" elif file_format_type == "Excel": from frappe.utils.xlsxutils import make_xlsx