From b43f70325c89f2b18e9e8467ccd7e6c8971794f3 Mon Sep 17 00:00:00 2001 From: ruthra kumar Date: Sun, 14 Jan 2024 15:52:37 +0530 Subject: [PATCH] fix: incorrect sql error if account name has '%' (cherry picked from commit 641c3de0caf3dd542a353edd78c8c18f686b8cae) --- .../report/customer_ledger_summary/customer_ledger_summary.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/erpnext/accounts/report/customer_ledger_summary/customer_ledger_summary.py b/erpnext/accounts/report/customer_ledger_summary/customer_ledger_summary.py index 0464f99d20..0f77bb38ec 100644 --- a/erpnext/accounts/report/customer_ledger_summary/customer_ledger_summary.py +++ b/erpnext/accounts/report/customer_ledger_summary/customer_ledger_summary.py @@ -376,6 +376,10 @@ class PartyLedgerSummaryReport(object): if not income_or_expense_accounts: # prevent empty 'in' condition income_or_expense_accounts.append("") + else: + # escape '%' in account name + # ignoring frappe.db.escape as it replaces single quotes with double quotes + income_or_expense_accounts = [x.replace("%", "%%") for x in income_or_expense_accounts] accounts_query = ( qb.from_(gl)