mirror of
https://github.com/frappe/erpnext.git
synced 2026-05-07 15:25:19 +00:00
fix: using query.walk() for escaping
(cherry picked from commit 5ea131c763)
This commit is contained in:
@@ -526,8 +526,6 @@ def get_accounting_entries(
|
|||||||
query = apply_additional_conditions(doctype, query, from_date, ignore_closing_entries, filters)
|
query = apply_additional_conditions(doctype, query, from_date, ignore_closing_entries, filters)
|
||||||
query = query.where(gl_entry.account.isin(accounts))
|
query = query.where(gl_entry.account.isin(accounts))
|
||||||
|
|
||||||
query = query.get_sql()
|
|
||||||
|
|
||||||
from frappe.desk.reportview import build_match_conditions
|
from frappe.desk.reportview import build_match_conditions
|
||||||
|
|
||||||
match_conditions = build_match_conditions(doctype)
|
match_conditions = build_match_conditions(doctype)
|
||||||
@@ -535,9 +533,9 @@ def get_accounting_entries(
|
|||||||
if match_conditions:
|
if match_conditions:
|
||||||
query += "and" + 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):
|
def apply_additional_conditions(doctype, query, from_date, ignore_closing_entries, filters):
|
||||||
|
|||||||
Reference in New Issue
Block a user