From d39e677d800530923892fb52762d5acf6652a3ca Mon Sep 17 00:00:00 2001 From: Krishna Shirsath Date: Wed, 2 Sep 2026 13:21:24 +0530 Subject: [PATCH] fix: handle missing bank reconciliation document types --- .../bank_reconciliation_tool/bank_reconciliation_tool.py | 1 + .../test_bank_reconciliation_tool.py | 5 +++++ 2 files changed, 6 insertions(+) diff --git a/erpnext/accounts/doctype/bank_reconciliation_tool/bank_reconciliation_tool.py b/erpnext/accounts/doctype/bank_reconciliation_tool/bank_reconciliation_tool.py index 38c81232252..7d69e122f17 100644 --- a/erpnext/accounts/doctype/bank_reconciliation_tool/bank_reconciliation_tool.py +++ b/erpnext/accounts/doctype/bank_reconciliation_tool/bank_reconciliation_tool.py @@ -1138,6 +1138,7 @@ def check_matching( from_reference_date=None, to_reference_date=None, ): + document_types = document_types or [] exact_match = True if "exact_match" in document_types else False common_filters = frappe._dict( diff --git a/erpnext/accounts/doctype/bank_reconciliation_tool/test_bank_reconciliation_tool.py b/erpnext/accounts/doctype/bank_reconciliation_tool/test_bank_reconciliation_tool.py index 031f74f1a85..4127922519e 100644 --- a/erpnext/accounts/doctype/bank_reconciliation_tool/test_bank_reconciliation_tool.py +++ b/erpnext/accounts/doctype/bank_reconciliation_tool/test_bank_reconciliation_tool.py @@ -10,6 +10,7 @@ from erpnext.accounts.doctype.bank_reconciliation_tool.bank_reconciliation_tool auto_reconcile_vouchers, get_auto_reconcile_message, get_bank_transactions, + get_linked_payments, ) from erpnext.accounts.doctype.payment_entry.test_payment_entry import create_payment_entry from erpnext.accounts.test.accounts_mixin import AccountsTestMixin @@ -119,6 +120,10 @@ class TestBankReconciliationTool(ERPNextTestSuite, AccountsTestMixin): names = [t.name for t in get_bank_transactions(self.bank_account, to_date=add_days(today(), -1))] self.assertEqual(names, []) + def test_get_linked_payments_without_document_types(self): + bank_transaction = self.make_bank_transaction(date=today()) + self.assertEqual(get_linked_payments(bank_transaction.name), []) + def test_auto_reconcile_message_for_no_matches(self): message, indicator = get_auto_reconcile_message([], []) self.assertEqual(indicator, "blue")