frappe / erpnext

Free and Open Source Enterprise Resource Planning (ERP)
https://erpnext.com
GNU General Public License v3.0
21.84k stars 7.33k forks source link

1054, "Unknown column 'tabContact.is_billing_contact' in 'where clause'" #43509

Closed iamejaaz closed 1 month ago

iamejaaz commented 1 month ago

Information about bug

I am getting an unknown column error while creating a customer from a Quotation Doctype. image

There is no field called "is_billing_contact" in the Customer doctype JSON file, but there is one in another JSON file. image

Module

selling

Version

"erpnext": "16.0.0-dev", "frappe": "16.0.0-dev", "hrms": "16.0.0-dev"

Installation method

None

Relevant log output / Stack trace / Full Error Message.

### App Versions

{
    "erpnext": "16.0.0-dev",
    "frappe": "16.0.0-dev",
    "hrms": "16.0.0-dev"
}

Route

Form/Quotation/new-quotation-osljqkbdql

Traceback

Traceback (most recent call last):
  File "apps/frappe/frappe/app.py", line 115, 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 1823, in call
    return fn(*args, **newargs)
  File "apps/frappe/frappe/utils/typing_validations.py", line 32, in wrapper
    return func(*args, **kwargs)
  File "apps/erpnext/erpnext/accounts/party.py", line 74, in get_party_details
    return _get_party_details(
  File "apps/erpnext/erpnext/accounts/party.py", line 133, in _get_party_details
    set_contact_details(party_details, party, party_type)
  File "apps/erpnext/erpnext/accounts/party.py", line 306, in set_contact_details
    party_details.contact_person = get_default_contact(party_type, party.name)
  File "apps/erpnext/erpnext/accounts/party.py", line 932, in get_default_contact
    contacts = frappe.get_all(
  File "apps/frappe/frappe/__init__.py", line 2112, in get_all
    return get_list(doctype, *args, **kwargs)
  File "apps/frappe/frappe/__init__.py", line 2087, in get_list
    return frappe.model.db_query.DatabaseQuery(doctype).execute(*args, **kwargs)
  File "apps/frappe/frappe/model/db_query.py", line 193, in execute
    result = self.build_and_run()
  File "apps/frappe/frappe/model/db_query.py", line 234, in build_and_run
    return frappe.db.sql(
  File "apps/frappe/frappe/database/database.py", line 236, 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 'tabContact.is_billing_contact' in 'where clause'")

Request Data

{
    "type": "POST",
    "args": {
        "party": "John Doe",
        "party_type": "Customer",
        "price_list": "Standard Selling",
        "posting_date": "2024-10-06",
        "fetch_payment_terms_template": 1,
        "currency": "INR",
        "company": "Ejaaz Khan",
        "doctype": "Quotation"
    },
    "headers": {},
    "error_handlers": {},
    "url": "/api/method/erpnext.accounts.party.get_party_details",
    "request_id": null
}

Response Data

{
    "exception": "pymysql.err.OperationalError: (1054, \"Unknown column 'tabContact.is_billing_contact' in 'where clause'\")",
    "exc_type": "OperationalError",
    "_exc_source": "erpnext (app)"
}
Nihantra-Patel commented 1 month ago

We tested variaous flow but we haven't found the issue.

scrnli_TtpGnQVbFweTXi.webm

iamejaaz commented 1 month ago

We tested variaous flow but we haven't found the issue.

scrnli_TtpGnQVbFweTXi.webm

Try creating a new site, installing the HRMS app on it, and then create a customer directly from the Quotation Doctype.

Nihantra-Patel commented 1 month ago

Already hrms installed on site and the site is new. also, i tested on frappe cloud side, we haven't found the issue.

iamejaaz commented 1 month ago

Already hrms installed on site and the site is new. also, i tested on frappe cloud side, we haven't found the issue.

Okay, I will check again and let you know.

iamejaaz commented 1 month ago

Hey @Nihantra-Patel I have attached video can you please check it now?

https://github.com/user-attachments/assets/17c95f92-1cba-45d3-a2c1-5a666f37b28b

One more thing: the error message shows version 16 for all apps, but when I check the version in the About menu, it shows as version 15 for Frappe and ERPNext.

image
Nihantra-Patel commented 1 month ago

please upgrade your develop branch and check it.

scrnli_3cQUzSmqHCggyP.webm

iamejaaz commented 1 month ago

please upgrade your develop branch and check it.

scrnli_3cQUzSmqHCggyP.webm

Okay, I will check and let you know by tomorrow.

iamejaaz commented 1 month ago

please upgrade your develop branch and check it.

scrnli_3cQUzSmqHCggyP.webm

Upgrading resolved the issue. Thank you.