2023-11-23 17:36:07,777 9 ERROR…
- User
Other models, same or similar prompt
Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.
Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.
2023-11-23 17:36:07,777 9 ERROR dibonltd-dibon-internal-app-bt-survey-ajax-upload-f-10616704 odoo.sql_db: bad query: ALTER TABLE "hr_appraisal" ALTER COLUMN "state" DROP DEFAULT, ALTER COLUMN "state" TYPE int4 USING "state"::int4
ERROR: invalid input syntax for type integer: "cancel" 2023-11-23 17:36:07,793 9 WARNING dibonltd-dibon-internal-app-bt-survey-ajax-upload-f-10616704 odoo.modules.loading: Transient module states were reset 2023-11-23 17:36:07,800 9 ERROR dibonltd-dibon-internal-app-bt-survey-ajax-upload-f-10616704 odoo.modules.registry: Failed to load registry Traceback (most recent call last): File "/home/odoo/src/odoo/odoo/tools/sql.py", line 147, in _convert_column cr.execute(query, log_exceptions=False) File "/home/odoo/src/odoo/odoo/sql_db.py", line 321, in execute res = self._obj.execute(query, params) psycopg2.errors.FeatureNotSupported: cannot alter type of a column used by a view or rule DETAIL: rule _RETURN on view hr_appraisal_report depends on column "state"
During handling of the above exception, another exception occurred:
Traceback (most recent call last): File "/home/odoo/src/odoo/odoo/modules/registry.py", line 90, in new odoo.modules.load_modules(registry, force_demo, status, update_module) File "/home/odoo/src/odoo/odoo/modules/loading.py", line 488, in load_modules processed_modules += load_marked_modules(cr, graph, File "/home/odoo/src/odoo/odoo/modules/loading.py", line 372, in load_marked_modules loaded, processed = load_module_graph( File "/home/odoo/src/odoo/odoo/modules/loading.py", line 208, in load_module_graph registry.init_models(cr, model_names, {'module': package.name}, new_install) File "/home/odoo/src/odoo/odoo/modules/registry.py", line 526, in init_models model._auto_init() File "/home/odoo/src/odoo/odoo/models.py", line 2578, in _auto_init new = field.update_db(self, columns) File "/home/odoo/src/odoo/odoo/fields.py", line 2929, in update_db return super(Many2one, self).update_db(model, columns) File "/home/odoo/src/odoo/odoo/fields.py", line 1006, in update_db self.update_db_column(model, column) File "/home/odoo/src/odoo/odoo/fields.py", line 2932, in update_db_column super(Many2one, self).update_db_column(model, column) File "/home/odoo/src/odoo/odoo/fields.py", line 1042, in update_db_column self._convert_db_column(model, column) File "/home/odoo/src/odoo/odoo/fields.py", line 1046, in _convert_db_column sql.convert_column(model._cr, model._table, self.name, self.column_type[1]) File "/home/odoo/src/odoo/odoo/tools/sql.py", line 128, in convert_column _convert_column(cr, tablename, columnname, columntype, using) File "/home/odoo/src/odoo/odoo/tools/sql.py", line 150, in _convert_column cr.execute(query) File "/home/odoo/src/odoo/odoo/sql_db.py", line 321, in execute res = self._obj.execute(query, params) psycopg2.errors.InvalidTextRepresentation: invalid input syntax for type integer: "cancel" 2023-11-23 17:36:07,803 9 CRITICAL dibonltd-dibon-internal-app-bt-survey-ajax-upload-f-10616704 odoo.service.server: Failed to initialize database dibonltd-dibon-internal-app-bt-survey-ajax-upload-f-10616704. Traceback (most recent call last): File "/home/odoo/src/odoo/odoo/tools/sql.py", line 147, in _convert_column cr.execute(query, log_exceptions=False) File "/home/odoo/src/odoo/odoo/sql_db.py", line 321, in execute res = self._obj.execute(query, params) psycopg2.errors.FeatureNotSupported: cannot alter type of a column used by a view or rule DETAIL: rule _RETURN on view hr_appraisal_report depends on column "state"
During handling of the above exception, another exception occurred:
Traceback (most recent call last): File "/home/odoo/src/odoo/odoo/service/server.py", line 1299, in preload_registries registry = Registry.new(dbname, update_module=update_module) File "", line 2, in new File "/home/odoo/src/odoo/odoo/tools/func.py", line 87, in locked return func(inst, *args, **kwargs) File "/home/odoo/src/odoo/odoo/modules/registry.py", line 90, in new odoo.modules.load_modules(registry, force_demo, status, update_module) File "/home/odoo/src/odoo/odoo/modules/loading.py", line 488, in load_modules processed_modules += load_marked_modules(cr, graph, File "/home/odoo/src/odoo/odoo/modules/loading.py", line 372, in load_marked_modules loaded, processed = load_module_graph( File "/home/odoo/src/odoo/odoo/modules/loading.py", line 208, in load_module_graph registry.init_models(cr, model_names, {'module': package.name}, new_install) File "/home/odoo/src/odoo/odoo/modules/registry.py", line 526, in init_models model._auto_init() File "/home/odoo/src/odoo/odoo/models.py", line 2578, in _auto_init new = field.update_db(self, columns) File "/home/odoo/src/odoo/odoo/fields.py", line 2929, in update_db return super(Many2one, self).update_db(model, columns) File "/home/odoo/src/odoo/odoo/fields.py", line 1006, in update_db self.update_db_column(model, column) File "/home/odoo/src/odoo/odoo/fields.py", line 2932, in update_db_column super(Many2one, self).update_db_column(model, column) File "/home/odoo/src/odoo/odoo/fields.py", line 1042, in update_db_column self._convert_db_column(model, column) File "/home/odoo/src/odoo/odoo/fields.py", line 1046, in _convert_db_column sql.convert_column(model._cr, model._table, self.name, self.column_type[1]) File "/home/odoo/src/odoo/odoo/tools/sql.py", line 128, in convert_column _convert_column(cr, tablename, columnname, columntype, using) File "/home/odoo/src/odoo/odoo/tools/sql.py", line 150, in _convert_column cr.execute(query) File "/home/odoo/src/odoo/odoo/sql_db.py", line 321, in execute res = self._obj.execute(query, params) psycopg2.errors.InvalidTextRepresentation: invalid input syntax for type integer: "cancel" 2023-11-23 17:36:07,806 9 INFO dibonltd-dibon-internal-app-bt-survey-ajax-upload-f-10616704 What is the error here
The error here is in the SQL query, which contains an invalid input for the integer type. The query is trying to drop the default value and change the column type for the "state" column in the "hr_appraisal" table. The invalid input is the string "cancel", which cannot be converted to an integer.
Additionally, the error message indicates that the "state" column is used by a view or rule, which means that you cannot alter the column type directly. Instead, you need to first remove the dependencies (the view or rule) and then alter the column type.
To fix this issue, you should modify the SQL query to remove the invalid input and ensure that there are no dependencies on the "state" column before altering its type.