Error in purches order v16?

Well , I have been struggle with this issue for few days
when i open the purches order page i got this
App Versions

{
	"frappe": "16.34.0",
	"erpnext": "16.35.0"
}

Route

Form/Purchase Order/new-purchase-order-uiaxurekmo

Traceback

Traceback (most recent call last):
  File "apps/frappe/frappe/app.py", line 158, in application
    response = frappe.api.handle(request)
  File "apps/frappe/frappe/api/__init__.py", line 63, in handle
    data = endpoint(**arguments)
  File "apps/frappe/frappe/api/v1.py", line 41, in handle_rpc_call
    return frappe.handler.handle()
           ~~~~~~~~~~~~~~~~~~~~~^^
  File "apps/frappe/frappe/handler.py", line 53, 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 1147, in call
    return fn(*args, **newargs)
  File "apps/frappe/frappe/utils/typing_validations.py", line 36, in wrapper
    return func(*args, **kwargs)
  File "apps/erpnext/erpnext/accounts/custom/address.py", line 69, in get_shipping_address
    address = frappe.get_all("Address", filters=filters, fields=fields) or {}
              ~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "apps/frappe/frappe/__init__.py", line 1405, in get_all
    return get_list(doctype, *args, **kwargs)
  File "apps/frappe/frappe/__init__.py", line 1380, in get_list
    return frappe.model.qb_query.DatabaseQuery(doctype).execute(*args, **kwargs)
           ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^
  File "apps/frappe/frappe/model/qb_query.py", line 222, in execute
    result = query.run(debug=debug, as_dict=not as_list, update=update)
  File "apps/frappe/frappe/query_builder/utils.py", line 139, in execute_query
    result = frappe.local.db.sql(query, params, *args, **kwargs)  # nosemgrep
  File "apps/frappe/frappe/database/database.py", line 272, in sql
    self.execute_query(query, values)
    ~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^
  File "apps/frappe/frappe/database/database.py", line 372, in execute_query
    return self._cursor.execute(query, values)
           ~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^
  File "env/lib/python3.14/site-packages/MySQLdb/cursors.py", line 179, in execute
    res = self._query(mogrified_query)
  File "env/lib/python3.14/site-packages/MySQLdb/cursors.py", line 330, in _query
    db.query(q)
    ~~~~~~~~^^^
  File "env/lib/python3.14/site-packages/MySQLdb/connections.py", line 280, in query
    _mysql.connection.query(self, query)
    ~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^
MySQLdb.OperationalError: (1054, "Unknown column 'tabAddress.is_your_company_address' in 'WHERE'")

Request Data

{
	"type": "POST",
	"args": {
		"company": "nova tech"
	},
	"headers": {},
	"error_handlers": {},
	"url": "/api/method/erpnext.accounts.custom.address.get_shipping_address",
	"request_id": null
}

Response Data

{
	"exception": "MySQLdb.OperationalError: (1054, \"Unknown column 'tabAddress.is_your_company_address' in 'WHERE'\")",
	"exc_type": "OperationalError",
	"_exc_source": "erpnext (app)"
}

when i tap in supplier field i got this issue

App Versions

{
	"frappe": "16.34.0",
	"erpnext": "16.35.0"
}

Route

Form/Purchase Order/new-purchase-order-ibquijlehi

Traceback

Traceback (most recent call last):
  File "apps/frappe/frappe/app.py", line 158, in application
    response = frappe.api.handle(request)
  File "apps/frappe/frappe/api/__init__.py", line 63, in handle
    data = endpoint(**arguments)
  File "apps/frappe/frappe/api/v1.py", line 41, in handle_rpc_call
    return frappe.handler.handle()
           ~~~~~~~~~~~~~~~~~~~~~^^
  File "apps/frappe/frappe/handler.py", line 53, 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 1147, in call
    return fn(*args, **newargs)
  File "apps/frappe/frappe/utils/typing_validations.py", line 36, in wrapper
    return func(*args, **kwargs)
  File "apps/erpnext/erpnext/accounts/party.py", line 97, in get_party_details
    return _get_party_details(
    	party,
    ...<14 lines>...
    	pos_profile,
    )
  File "apps/erpnext/erpnext/accounts/party.py", line 159, in _get_party_details
    set_contact_details(party_details, party, party_type)
    ~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "apps/erpnext/erpnext/accounts/party.py", line 351, in set_contact_details
    party_details.contact_person = get_default_contact(party_type, party.name)
                                   ~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^
  File "apps/erpnext/erpnext/accounts/party.py", line 1075, in get_default_contact
    contacts = frappe.get_all(
    	"Contact",
    ...<10 lines>...
    	order_by="is_primary_contact DESC, is_billing_contact DESC",
    )
  File "apps/frappe/frappe/__init__.py", line 1405, in get_all
    return get_list(doctype, *args, **kwargs)
  File "apps/frappe/frappe/__init__.py", line 1380, in get_list
    return frappe.model.qb_query.DatabaseQuery(doctype).execute(*args, **kwargs)
           ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^
  File "apps/frappe/frappe/model/qb_query.py", line 220, in execute
    result = query.run(debug=debug, as_dict=True, pluck=pluck)
  File "apps/frappe/frappe/query_builder/utils.py", line 139, in execute_query
    result = frappe.local.db.sql(query, params, *args, **kwargs)  # nosemgrep
  File "apps/frappe/frappe/database/database.py", line 272, in sql
    self.execute_query(query, values)
    ~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^
  File "apps/frappe/frappe/database/database.py", line 372, in execute_query
    return self._cursor.execute(query, values)
           ~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^
  File "env/lib/python3.14/site-packages/MySQLdb/cursors.py", line 179, in execute
    res = self._query(mogrified_query)
  File "env/lib/python3.14/site-packages/MySQLdb/cursors.py", line 330, in _query
    db.query(q)
    ~~~~~~~~^^^
  File "env/lib/python3.14/site-packages/MySQLdb/connections.py", line 280, in query
    _mysql.connection.query(self, query)
    ~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^
MySQLdb.OperationalError: (1054, "Unknown column 'tabContact.is_billing_contact' in 'WHERE'")

Request Data

{
	"type": "POST",
	"args": {
		"party": "Global Electronics Ltd.",
		"party_type": "Supplier",
		"price_list": "Standard Buying",
		"posting_date": "2026-07-28",
		"fetch_payment_terms_template": 1,
		"currency": "YER",
		"company": "nova tech",
		"doctype": "Purchase Order"
	},
	"headers": {},
	"error_handlers": {},
	"url": "/api/method/erpnext.accounts.party.get_party_details",
	"request_id": null
}

Response Data

{
	"exception": "MySQLdb.OperationalError: (1054, \"Unknown column 'tabContact.is_billing_contact' in 'WHERE'\")",
	"exc_type": "OperationalError",
	"_exc_source": "erpnext (app)"
}

i though it was an issue in my frappe version i tried to updated then migrated nothing helped

The issue was from the patch of that column so what i did is the following :
1- I deleted the patch from the log
2- I migrated the site
3- the field added again

the page worked fine :slight_smile: