frappe / erpnext

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

Renaming a custom Document: tabPayment Reconciliation Allocation' doesn't exist #39723

Open maovidal opened 9 months ago

maovidal commented 9 months ago

Information about bug

While renaming any of my custom DocType I have called Business Unit I'm getting the error log below. Just in case it may be relevant, that custom document is used as a base for a Accounting dimension.

Module

accounts

Version

ERPNext: v15.11.1 Frappe Framework: v15.12.0 Frappe HR: v15.10.0

Installation method

docker

Relevant log output / Stack trace / Full Error Message.

Traceback (most recent call last):
  File "apps/frappe/frappe/model/document.py", line 1632, in execute_action
    getattr(doc, __action)(**kwargs)
  File "apps/frappe/frappe/model/document.py", line 1036, in _rename
    self.name = rename_doc(doc=self, new=name, merge=merge, force=force, validate=validate_rename)
                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "apps/frappe/frappe/model/rename_doc.py", line 184, in rename_doc
    update_link_field_values(link_fields, old, new, doctype)
  File "apps/frappe/frappe/model/rename_doc.py", line 449, in update_link_field_values
    frappe.db.set_value(parent, {docfield: old}, docfield, new, update_modified=False)
  File "apps/frappe/frappe/database/database.py", line 980, in set_value
    query.run(debug=debug)
  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 235, in sql
    self._cursor.execute(query, values)
  File "env/lib/python3.11/site-packages/pymysql/cursors.py", line 153, in execute
    result = self._query(query)
             ^^^^^^^^^^^^^^^^^^
  File "env/lib/python3.11/site-packages/pymysql/cursors.py", line 322, in _query
    conn.query(q)
  File "env/lib/python3.11/site-packages/pymysql/connections.py", line 558, in query
    self._affected_rows = self._read_query_result(unbuffered=unbuffered)
                          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "env/lib/python3.11/site-packages/pymysql/connections.py", line 822, in _read_query_result
    result.read()
  File "env/lib/python3.11/site-packages/pymysql/connections.py", line 1200, in read
    first_packet = self.connection._read_packet()
                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "env/lib/python3.11/site-packages/pymysql/connections.py", line 772, in _read_packet
    packet.raise_for_error()
  File "env/lib/python3.11/site-packages/pymysql/protocol.py", line 221, in raise_for_error
    err.raise_mysql_exception(self._data)
  File "env/lib/python3.11/site-packages/pymysql/err.py", line 143, in raise_mysql_exception
    raise errorclass(errno, errval)
pymysql.err.ProgrammingError: (1146, "Table '_d102a0cb67e30e1c.tabPayment Reconciliation Allocation' doesn't exist")
maovidal commented 9 months ago

It may seem related to #35059