Merge pull request #47807 from frappe/mergify/bp/version-14-hotfix/pr-47794

fix: use `query.walk() `for escaping special chars in receiable/payable report (backport #47794)
This commit is contained in:
ruthra kumar
2025-05-29 14:58:45 +05:30
committed by GitHub

View File

@@ -118,7 +118,8 @@ class ReceivablePayableReport:
self.build_data()
def fetch_ple_in_buffered_cursor(self):
self.ple_entries = frappe.db.sql(self.ple_query.get_sql(), as_dict=True)
query, param = self.ple_query.walk()
self.ple_entries = frappe.db.sql(query, param, as_dict=True)
for ple in self.ple_entries:
self.init_voucher_balance(ple) # invoiced, paid, credit_note, outstanding
@@ -131,8 +132,9 @@ class ReceivablePayableReport:
def fetch_ple_in_unbuffered_cursor(self):
self.ple_entries = []
query, param = self.ple_query.walk()
with frappe.db.unbuffered_cursor():
for ple in frappe.db.sql(self.ple_query.get_sql(), as_dict=True, as_iterator=True):
for ple in frappe.db.sql(query, param, as_dict=True, as_iterator=True):
self.init_voucher_balance(ple) # invoiced, paid, credit_note, outstanding
self.ple_entries.append(ple)