From 3a7e335d4b616f72aceebaf96216c1631be4e57a Mon Sep 17 00:00:00 2001 From: ljain112 Date: Tue, 17 Dec 2024 18:49:38 +0530 Subject: [PATCH] fix: using query.walk() for escaping (cherry picked from commit 5ea131c763633e1c93abddcbcd551d6d10df7336) --- erpnext/accounts/report/financial_statements.py | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/erpnext/accounts/report/financial_statements.py b/erpnext/accounts/report/financial_statements.py index 4c376effc2a..cd0f7e90e04 100644 --- a/erpnext/accounts/report/financial_statements.py +++ b/erpnext/accounts/report/financial_statements.py @@ -526,8 +526,6 @@ def get_accounting_entries( query = apply_additional_conditions(doctype, query, from_date, ignore_closing_entries, filters) query = query.where(gl_entry.account.isin(accounts)) - query = query.get_sql() - from frappe.desk.reportview import build_match_conditions match_conditions = build_match_conditions(doctype) @@ -535,9 +533,9 @@ def get_accounting_entries( if match_conditions: query += "and" + match_conditions - entries = frappe.db.sql(query, as_dict=True) + query, params = query.walk() - return entries + return frappe.db.sql(query, params, as_dict=True) def apply_additional_conditions(doctype, query, from_date, ignore_closing_entries, filters):