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

Unknown column 'default_bank_account' in 'field list' bug in Payment Entry related to selecting an employee as a party type #41044

Closed
alaahariri opened this issue Apr 16, 2024 · 3 comments
Labels

Comments

@alaahariri
Copy link

alaahariri commented Apr 16, 2024

Information about bug

Installed Apps

ERPNext: v15.20.3 (version-15)
Frappe Framework: v15.22.0 (version-15)
Frappe HR: v15.17.0 (version-15)

To replicate:

  • Create a Payment Entry
  • Select Employee as Party Type
  • Select any employee

The below error shows:
image

Module

accounts, HR

Version

ERPNext: v15.20.3 (version-15)
Frappe Framework: v15.22.0 (version-15)
Frappe HR: v15.17.0 (version-15)

Installation method

None

Relevant log output / Stack trace / Full Error Message.

Traceback: 

### App Versions

{
	"erpnext": "15.20.3",
	"frappe": "15.22.0",
	"hrms": "15.17.0",
}
### Route

Form/Payment Entry/new-payment-entry-mvcvsdufaf

### Traceback

Traceback (most recent call last):
File "apps/frappe/frappe/app.py", line 110, 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 49, in handle
data = execute_cmd(cmd)
File "apps/frappe/frappe/handler.py", line 85, in execute_cmd
return frappe.call(method, **frappe.form_dict)
File "apps/frappe/frappe/init.py", line 1718, 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/payment_entry/payment_entry.py", line 2043, in get_party_details
bank_account = get_default_company_bank_account(company, party_type, party)
File "apps/erpnext/erpnext/accounts/doctype/bank_account/bank_account.py", line 138, in get_default_company_bank_account
default_company_bank_account = frappe.db.get_value(party_type, party, "default_bank_account")
File "apps/frappe/frappe/database/database.py", line 519, in get_value
result = self.get_values(
File "apps/frappe/frappe/database/database.py", line 623, in get_values
out = self._get_values_from_table(
File "apps/frappe/frappe/database/database.py", line 896, in _get_values_from_table
return query.run(as_dict=as_dict, debug=debug, update=update, run=run, pluck=pluck)
File "apps/frappe/frappe/query_builder/utils.py", line 87, in execute_query
result = frappe.db.sql(query, params, *args, **kwargs) # nosemgrep
File "apps/frappe/frappe/database/database.py", line 234, in sql
self._cursor.execute(query, values)
File "env/lib/python3.10/site-packages/pymysql/cursors.py", line 153, in execute
result = self._query(query)
File "env/lib/python3.10/site-packages/pymysql/cursors.py", line 322, in _query
conn.query(q)
File "env/lib/python3.10/site-packages/pymysql/connections.py", line 558, in query
self._affected_rows = self._read_query_result(unbuffered=unbuffered)
File "env/lib/python3.10/site-packages/pymysql/connections.py", line 822, in _read_query_result
result.read()
File "env/lib/python3.10/site-packages/pymysql/connections.py", line 1200, in read
first_packet = self.connection._read_packet()
File "env/lib/python3.10/site-packages/pymysql/connections.py", line 772, in _read_packet
packet.raise_for_error()
File "env/lib/python3.10/site-packages/pymysql/protocol.py", line 221, in raise_for_error
err.raise_mysql_exception(self._data)
File "env/lib/python3.10/site-packages/pymysql/err.py", line 143, in raise_mysql_exception
raise errorclass(errno, errval)
pymysql.err.OperationalError: (1054, "Unknown column 'default_bank_account' in 'field list'")

### Request Data

{
"type": "POST",
"args": {
"company": "Asklan",
"party_type": "Employee",
"party": "HR-EMP-00008",
"date": "2024-04-16"
},
"headers": {},
"error_handlers": {},
"url": "/api/method/erpnext.accounts.doctype.payment_entry.payment_entry.get_party_details",
"request_id": null
}

### Response Data

{
"exception": "pymysql.err.OperationalError: (1054, "Unknown column 'default_bank_account' in 'field list'")",
"exc_type": "OperationalError",
"_exc_source": "erpnext (app)"
}

@alaahariri alaahariri added the bug label Apr 16, 2024
@Nihantra-Patel
Copy link
Contributor

Already raised the PR: #41007

@0xhaval
Copy link

0xhaval commented Apr 23, 2024

Kindly, any update with this bug.
I have the same issue
image

image

@Nihantra-Patel
Copy link
Contributor

Issue has been fixed: #41104

scrnli_30_04_2024_11-38-32.mp4

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants