resilient-tech / india-compliance

Simple, yet powerful compliance solutions for Indian businesses
https://indiacompliance.app
GNU General Public License v3.0
142 stars 127 forks source link

Unknown Column error #1971

Closed poojavadher closed 4 months ago

poojavadher commented 5 months ago

Information about bug

An error occurred while installing india_compliance: (1054, "Unknown column 'is_nil_exempt' in 'field list'")

Version

Frappe Version - 14.70.0 ERPNext Version - 14.66.2 India Compliance Version - 14

Relevant log output / Stack trace / Full Error Message.

App erpnext already installed

Installing india_compliance...
Updating DocTypes for india_compliance: [========================================] 100%
Setting up Income Tax...
Setting up GST...
Patching Existing Data...
The account type for your GST accounts could not be set automatically. Please set it manually in GST settings.

Installation for India Compliance failed due to an error. Please try re-installing the app or report the issue on https://github.com/resilient-tech/india-compliance/issues/new if not resolved.
An error occurred while installing india_compliance: (1054, "Unknown column 'is_nil_exempt' in 'field list'")
Traceback (most recent call last):
  File "apps/frappe/frappe/commands/site.py", line 400, in install_app
    _install_app(app, verbose=context.verbose, force=force)
  File "apps/frappe/frappe/installer.py", line 305, in install_app
    frappe.get_attr(after_install)()
  File "apps/india_compliance/india_compliance/install.py", line 73, in after_install
    raise e
  File "apps/india_compliance/india_compliance/install.py", line 62, in after_install
    run_post_install_patches()
  File "apps/india_compliance/india_compliance/install.py", line 86, in run_post_install_patches
    frappe.get_attr(f"india_compliance.patches.post_install.{patch}.execute")()
  File "apps/india_compliance/india_compliance/patches/post_install/improve_item_tax_template.py", line 62, in execute
    update_gst_treatment_for_transactions()
  File "apps/india_compliance/india_compliance/patches/post_install/improve_item_tax_template.py", line 288, in update_gst_treatment_for_transactions
    .run()
  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 244, in sql
    self._cursor.execute(query, values)
  File "env/lib/python3.10/site-packages/pymysql/cursors.py", line 158, in execute
    result = self._query(query)
  File "env/lib/python3.10/site-packages/pymysql/cursors.py", line 325, in _query
    conn.query(q)
  File "env/lib/python3.10/site-packages/pymysql/connections.py", line 549, in query
    self._affected_rows = self._read_query_result(unbuffered=unbuffered)
  File "env/lib/python3.10/site-packages/pymysql/connections.py", line 779, in _read_query_result
    result.read()
  File "env/lib/python3.10/site-packages/pymysql/connections.py", line 1157, in read
    first_packet = self.connection._read_packet()
  File "env/lib/python3.10/site-packages/pymysql/connections.py", line 729, 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 'is_nil_exempt' in 'field list'")

Code of Conduct

vorasmit commented 5 months ago

Is this a new installation?

This is very strange. How is it possible that is_nil_exempt is available in item doctype but not in child tables?

Do you have custom apps where you exported customisations?

poojavadher commented 5 months ago

Yes, this is new installation and i restored backup from v13. then i tried to install the app india compliance before my custom app.

I have following fields for "is_nil_exempt" available to the custom field list. image

poojavadher commented 5 months ago

following doctypes to export customizations image

vorasmit commented 4 months ago

Custom fields from India Compliance app is exported in custom app and is causing this issue. Although a field is deleted in India Compliance app, it's getting reverted back in your site, as it's part of your custom app.