From fc793f0f253b3b356ab4a5b70152ae2abdbb2ae4 Mon Sep 17 00:00:00 2001 From: ruthra kumar Date: Mon, 5 May 2025 13:58:08 +0530 Subject: [PATCH] refactor: set default for fetch methods --- .../report/accounts_receivable/accounts_receivable.py | 7 ++++--- erpnext/patches.txt | 1 + 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/erpnext/accounts/report/accounts_receivable/accounts_receivable.py b/erpnext/accounts/report/accounts_receivable/accounts_receivable.py index adf1894371b..5e31542fa44 100644 --- a/erpnext/accounts/report/accounts_receivable/accounts_receivable.py +++ b/erpnext/accounts/report/accounts_receivable/accounts_receivable.py @@ -49,9 +49,10 @@ class ReceivablePayableReport: self.age_as_on = ( getdate(nowdate()) if self.filters.report_date > getdate(nowdate()) else self.filters.report_date ) - self.ple_fetch_method = frappe.db.get_single_value( - "Accounts Settings", "receivable_payable_fetch_method" - ) + self.ple_fetch_method = ( + frappe.db.get_single_value("Accounts Settings", "receivable_payable_fetch_method") + or "Buffered Cursor" + ) # Fail Safe def run(self, args): self.filters.update(args) diff --git a/erpnext/patches.txt b/erpnext/patches.txt index c2a25b93055..bee1aaa07f5 100644 --- a/erpnext/patches.txt +++ b/erpnext/patches.txt @@ -373,3 +373,4 @@ execute:frappe.db.set_single_value("Accounts Settings", "exchange_gain_loss_post erpnext.patches.v14_0.update_posting_datetime erpnext.stock.doctype.stock_ledger_entry.patches.ensure_sle_indexes erpnext.patches.v14_0.rename_group_by_to_categorize_by +execute:frappe.db.set_single_value("Accounts Settings", "receivable_payable_fetch_method", "Buffered Cursor")