Skip to content

Commit 40a8ed8

Browse files
ljain112mergify[bot]
authored andcommitted
fix: using query.walk() for escaping
(cherry picked from commit 5ea131c)
1 parent 83aeb2e commit 40a8ed8

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

erpnext/accounts/report/financial_statements.py

+2-4
Original file line numberDiff line numberDiff line change
@@ -527,18 +527,16 @@ def get_accounting_entries(
527527
account_filter_query = get_account_filter_query(root_lft, root_rgt, root_type, gl_entry)
528528
query = query.where(ExistsCriterion(account_filter_query))
529529

530-
query = query.get_sql()
531-
532530
from frappe.desk.reportview import build_match_conditions
533531

534532
match_conditions = build_match_conditions(doctype)
535533

536534
if match_conditions:
537535
query += "and" + match_conditions
538536

539-
entries = frappe.db.sql(query, as_dict=True)
537+
query, params = query.walk()
540538

541-
return entries
539+
return frappe.db.sql(query, params, as_dict=True)
542540

543541

544542
def get_account_filter_query(root_lft, root_rgt, root_type, gl_entry):

0 commit comments

Comments
 (0)