safe encode non ascii characters (#15755)
diff --git a/erpnext/accounts/report/financial_statements.py b/erpnext/accounts/report/financial_statements.py
index 557f5b3..d030f5f 100644
--- a/erpnext/accounts/report/financial_statements.py
+++ b/erpnext/accounts/report/financial_statements.py
@@ -379,8 +379,8 @@
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_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: