Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bank Reconciliation tool fails with KeyError: 'payment_doctype' #2591

Open
conncampbell opened this issue Jan 7, 2025 · 0 comments
Open
Labels
bug Something isn't working

Comments

@conncampbell
Copy link

Information about bug

When matching paid expense claims using the bank reconciliation tool, an error is generated when submitting. It appears the utilities get_ec_matching_query method does not return the doctype.

Module

HR

Version

ERPNext: v15.47.4 (version-15)

Frappe Framework: v15.51.1 (version-15)

Frappe HR: v15.37.1 (version-15)

Installation method

manual install

Relevant log output / Stack trace / Full Error Message.

### App Versions

{
	"builder": "1.13.0",
	"erpnext": "15.47.4",
	"frappe": "15.51.1",
	"hrms": "15.37.1",
	"insights": "3.0.14",
	"payments": "0.0.1"
}

Route

Form/Bank Reconciliation Tool/Bank Reconciliation Tool

Traceback

Traceback (most recent call last):
  File "apps/frappe/frappe/app.py", line 114, in application
    response = frappe.api.handle(request)
               ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "apps/frappe/frappe/api/__init__.py", line 49, in handle
    data = endpoint(**arguments)
           ^^^^^^^^^^^^^^^^^^^^^
  File "apps/frappe/frappe/api/v1.py", line 36, in handle_rpc_call
    return frappe.handler.handle()
           ^^^^^^^^^^^^^^^^^^^^^^^
  File "apps/frappe/frappe/handler.py", line 50, in handle
    data = execute_cmd(cmd)
           ^^^^^^^^^^^^^^^^
  File "apps/frappe/frappe/handler.py", line 86, in execute_cmd
    return frappe.call(method, **frappe.form_dict)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "apps/frappe/frappe/__init__.py", line 1726, in call
    return fn(*args, **newargs)
           ^^^^^^^^^^^^^^^^^^^^
  File "apps/frappe/frappe/utils/typing_validations.py", line 31, in wrapper
    return func(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^
  File "apps/erpnext/erpnext/accounts/doctype/bank_reconciliation_tool/bank_reconciliation_tool.py", line 443, in reconcile_vouchers
    transaction.add_payment_entries(vouchers)
  File "apps/erpnext/erpnext/accounts/doctype/bank_transaction/bank_transaction.py", line 135, in add_payment_entries
    "payment_document": voucher["payment_doctype"],
                        ~~~~~~~^^^^^^^^^^^^^^^^^^^
KeyError: 'payment_doctype'

Request Data

{
	"type": "POST",
	"args": {
		"bank_transaction_name": "ACC-BTN-2025-00069",
		"vouchers": "[{\"payment_name\":\"EXP00024-2\",\"amount\":\"$ 68.15\"}]"
	},
	"headers": {},
	"error_handlers": {},
	"url": "/api/method/erpnext.accounts.doctype.bank_reconciliation_tool.bank_reconciliation_tool.reconcile_vouchers",
	"request_id": null
}

Response Data

{
	"exception": "KeyError: 'payment_doctype'",
	"exc_type": "KeyError",
	"_exc_source": "erpnext (app)"
}


### Code of Conduct

- [X] I agree to follow this project's Code of Conduct
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant