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 34fe8447816..96701f1766e 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 5bad7582dde..26f5e62d441 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 @@ -131,6 +131,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_deposit_matches_amount_received_in_bank_account(self): # money leaves another bank account and lands here minus a charge, so the two sides differ payment = frappe.get_doc(