frappe/erpnext

pymysql.err.OperationalError: (1054, "Unknown column 'tabSubcontracting Receipt.purchase_order' in 'where clause'")

Closed this issue · 2 comments

Information about bug

After system update this server error appear when viewing a purchase order record:

pymysql.err.OperationalError: (1054, "Unknown column 'tabSubcontracting Receipt.purchase_order' in 'where clause'")

Module

buying

Version

ERPNext: v14.75.0 (HEAD)

Frappe Framework: v14.85.0 (HEAD)

Frappe HR: v14.35.0 (HEAD)

Frappe LMS: v2.9.0 (HEAD)

Installation method

FrappeCloud

Relevant log output / Stack trace / Full Error Message.

`### App Versions

{
	"erpnext": "14.75.0",
	"frappe": "14.85.0",
	"hrms": "14.35.0",
	"lms": "2.9.0"
}

Route

Form/Purchase Order/PUR-ORD-2024-00032

Traceback

Traceback (most recent call last):
  File "apps/frappe/frappe/app.py", line 97, in application
    response = frappe.api.handle()
  File "apps/frappe/frappe/api.py", line 55, in handle
    return frappe.handler.handle()
  File "apps/frappe/frappe/handler.py", line 48, 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 1619, in call
    return fn(*args, **newargs)
  File "apps/frappe/frappe/__init__.py", line 815, in wrapper_fn
    retval = fn(*args, **get_newargs(fn, kwargs))
  File "apps/frappe/frappe/desk/notifications.py", line 293, in get_open_count
    external_links_data_for_d = get_external_links(d, name, links)
  File "apps/frappe/frappe/desk/notifications.py", line 340, in get_external_links
    total_count = get_doc_count(doctype, filters)
  File "apps/frappe/frappe/desk/notifications.py", line 352, in get_doc_count
    frappe.get_all(
  File "apps/frappe/frappe/__init__.py", line 1938, in get_all
    return get_list(doctype, *args, **kwargs)
  File "apps/frappe/frappe/__init__.py", line 1910, in get_list
    return frappe.model.db_query.DatabaseQuery(doctype).execute(*args, **kwargs)
  File "apps/frappe/frappe/model/db_query.py", line 190, in execute
    result = self.build_and_run()
  File "apps/frappe/frappe/model/db_query.py", line 231, in build_and_run
    return frappe.db.sql(
  File "apps/frappe/frappe/database/database.py", line 244, 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 563, in query
    self._affected_rows = self._read_query_result(unbuffered=unbuffered)
  File "env/lib/python3.10/site-packages/pymysql/connections.py", line 825, in _read_query_result
    result.read()
  File "env/lib/python3.10/site-packages/pymysql/connections.py", line 1199, in read
    first_packet = self.connection._read_packet()
  File "env/lib/python3.10/site-packages/pymysql/connections.py", line 775, in _read_packet
    packet.raise_for_error()
  File "env/lib/python3.10/site-packages/pymysql/protocol.py", line 219, in raise_for_error
    err.raise_mysql_exception(self._data)
  File "env/lib/python3.10/site-packages/pymysql/err.py", line 150, in raise_mysql_exception
    raise errorclass(errno, errval)
pymysql.err.OperationalError: (1054, "Unknown column 'tabSubcontracting Receipt.purchase_order' in 'where clause'")

Request Data

{
	"type": "GET",
	"args": {
		"doctype": "Purchase Order",
		"name": "PUR-ORD-2024-00032",
		"items": "[\"Purchase Receipt\",\"Purchase Invoice\",\"Sales Order\",\"Payment Entry\",\"Journal Entry\",\"Payment Request\",\"Supplier Quotation\",\"Project\",\"Auto Repeat\",\"Material Request\",\"BOM\",\"Production Plan\",\"Blanket Order\",\"Subcontracting Order\",\"Subcontracting Receipt\",\"Stock Entry\",\"Sales Order\"]"
	},
	"headers": {},
	"error_handlers": {},
	"url": "/api/method/frappe.desk.notifications.get_open_count"
}

Response Data

{
	"exception": "pymysql.err.OperationalError: (1054, \"Unknown column 'tabSubcontracting Receipt.purchase_order' in 'where clause'\")"
}

Issue has been fixed: #44014

I'm encountering the same error on my cloud instance of ERPNext. How can I resolve this issue?