From 614b042ed37fa6b408b8fe059935a45abd8359e3 Mon Sep 17 00:00:00 2001 From: Nabin Hait Date: Tue, 6 Nov 2018 11:48:51 +0530 Subject: [PATCH 1/2] fix(encoding): Fixed encoding issue in financial statements --- erpnext/accounts/report/financial_statements.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/erpnext/accounts/report/financial_statements.py b/erpnext/accounts/report/financial_statements.py index d030f5f706f..1d382484e91 100644 --- a/erpnext/accounts/report/financial_statements.py +++ b/erpnext/accounts/report/financial_statements.py @@ -1,7 +1,9 @@ +# -*- coding: utf-8 -*- + # Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors # License: GNU General Public License v3. See license.txt - +from __future__ import unicode_literals import re from past.builtins import cmp @@ -342,7 +344,7 @@ def set_gl_entries_by_account( accounts = frappe.db.sql_list("""select name from `tabAccount` where lft >= %s and rgt <= %s""", (root_lft, root_rgt)) additional_conditions += " and account in ('{}')"\ - .format("', '".join([frappe.safe_encode(frappe.db.escape(d)) for d in accounts])) + .format("', '".join([frappe.db.escape(d) for d in accounts])) gl_entries = frappe.db.sql("""select posting_date, account, debit, credit, is_opening, fiscal_year, debit_in_account_currency, credit_in_account_currency, account_currency from `tabGL Entry` where company=%(company)s From 9eafe8c23e4f314ceb99bf329b0bc08f12b63184 Mon Sep 17 00:00:00 2001 From: rohitwaghchaure Date: Tue, 6 Nov 2018 13:28:18 +0530 Subject: [PATCH 2/2] Update financial_statements.py --- erpnext/accounts/report/financial_statements.py | 1 - 1 file changed, 1 deletion(-) diff --git a/erpnext/accounts/report/financial_statements.py b/erpnext/accounts/report/financial_statements.py index 1d382484e91..db733dd1e10 100644 --- a/erpnext/accounts/report/financial_statements.py +++ b/erpnext/accounts/report/financial_statements.py @@ -402,7 +402,6 @@ 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 = frappe.safe_encode(cost_centers) cost_centers = [d.strip() for d in cost_centers.strip().split(',') if d] all_cost_centers = []