AttributeError: 'NoneType' object has no attribute 'bank'

I get this Error when making payment from Purchase Invoice doctype

Traceback (most recent call last):
File “/home/administrator/frappe-bench/apps/frappe/frappe/”, line 61, in application
response = frappe.handler.handle()
File “/home/administrator/frappe-bench/apps/frappe/frappe/”, line 21, in handle
data = execute_cmd(cmd)
File “/home/administrator/frappe-bench/apps/frappe/frappe/”, line 56, in execute_cmd
return, **frappe.form_dict)
File “/home/administrator/frappe-bench/apps/frappe/frappe/”, line 1020, in call
return fn(*args, **newargs)
File “/home/administrator/frappe-bench/apps/erpnext/erpnext/accounts/doctype/payment_entry/”, line 911, in get_payment_entry
File “/home/administrator/frappe-bench/apps/erpnext/erpnext/accounts/doctype/payment_entry/”, line 98, in set_bank_account_data =
AttributeError: ‘NoneType’ object has no attribute ‘bank’

Solved! there was no bank account declared in my Company

Hi, the same error is happening again , although the default bank account in the company is properly set. it is showing this error with
ERPNext: v12.14.0 (version-12)
Frappe Framework: v12.12.0 (version-12)
Any advice or is it a bug in this version … it works good on the earlier version!!
ERPNext: v12.12.1 (version-12)
Frappe Framework: v12.10.2 (version-12)
I cannot create payment from the button “create” in the sales invoice- the error displays