From 16d45c8e2e8c2ea54f0bf5b7c65cadde82726385 Mon Sep 17 00:00:00 2001 From: Zarrar Date: Fri, 2 Nov 2018 13:17:24 +0530 Subject: [PATCH] safe encode non ascii characters (#15755) --- erpnext/accounts/report/financial_statements.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/erpnext/accounts/report/financial_statements.py b/erpnext/accounts/report/financial_statements.py index 557f5b3a58..d030f5f706 100644 --- a/erpnext/accounts/report/financial_statements.py +++ b/erpnext/accounts/report/financial_statements.py @@ -379,8 +379,8 @@ def get_additional_conditions(from_date, ignore_closing_entries, filters): if filters: if filters.get("project"): if not isinstance(filters.get("project"), list): - projects = str(filters.get("project")).strip() - filters.project = [d.strip() for d in projects.split(',') if d] + projects = frappe.safe_encode(filters.get("project")) + filters.project = [d.strip() for d in projects.strip().split(',') if d] additional_conditions.append("project in %(project)s") if filters.get("cost_center"): @@ -400,7 +400,8 @@ def get_additional_conditions(from_date, ignore_closing_entries, filters): def get_cost_centers_with_children(cost_centers): if not isinstance(cost_centers, list): - cost_centers = [d.strip() for d in str(cost_centers).strip().split(',') if d] + cost_centers = frappe.safe_encode(cost_centers) + cost_centers = [d.strip() for d in cost_centers.strip().split(',') if d] all_cost_centers = [] for d in cost_centers: