Skip to content

Commit

Permalink
fix: using query.walk() for escaping
Browse files Browse the repository at this point in the history
(cherry picked from commit 5ea131c)
  • Loading branch information
ljain112 authored and mergify[bot] committed Dec 17, 2024
1 parent 83aeb2e commit 40a8ed8
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions erpnext/accounts/report/financial_statements.py
Original file line number Diff line number Diff line change
Expand Up @@ -527,18 +527,16 @@ def get_accounting_entries(
account_filter_query = get_account_filter_query(root_lft, root_rgt, root_type, gl_entry)
query = query.where(ExistsCriterion(account_filter_query))

query = query.get_sql()

from frappe.desk.reportview import build_match_conditions

match_conditions = build_match_conditions(doctype)

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 get_account_filter_query(root_lft, root_rgt, root_type, gl_entry):
Expand Down

0 comments on commit 40a8ed8

Please sign in to comment.