-
-
Notifications
You must be signed in to change notification settings - Fork 705
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[13.0 -> 14.0] Migration fail due to "foreign key constraint does not exist" #2665
Comments
|
@pedrobaeza how can I skip the migration of "account" in the process? |
You can't skip anything. A DB is not able to be migrated if you don't have all the migration scripts for the whole module list. |
@pedrobaeza thanks for your reply! |
That's not possible for now if you have account installed. You have to wait. |
@pedrobaeza thanks for your information! |
See the progress in #2190 |
@pedrobaeza thanks! I will track it there. |
Hi,
i'm trying to migrate from Odoo 13 to Odoo 14 (i'm an Odoo newbie), but it fails when trying to reference at a not existing table (account_reconcile_model_line).
I also find that in file /odoo/addons/account/models/account_reconcile_model.py model AccountReconcileModelLine exists, so what is the problem?
Impacted versions: OpenUpgrade 14.0
Steps to reproduce: Just by executing procedure until it fail
Current behavior:
2021-04-16 14:19:45,506 12355 ERROR <db_name_masked> odoo.sql_db: bad query: ALTER TABLE "account_reconcile_model_analytic_tag_rel" ADD FOREIGN KEY ("account_reconcile_model_line_id") REFERENCES "account_reconcile_model_line"("id") ON DELETE cascade
ERROR: column "account_reconcile_model_line_id" referenced in foreign key constraint does not exist
2021-04-16 14:19:45,523 12355 WARNING <db_name_masked> odoo.modules.loading: Transient module states were reset
2021-04-16 14:19:45,526 12355 ERROR <db_name_masked> odoo.modules.registry: Failed to load registry
2021-04-16 14:19:45,526 12355 CRITICAL <db_name_masked> odoo.service.server: Failed to initialize database
<db_name_masked>
.Traceback (most recent call last):
File "/opt/openupgrade/odoo-14/odoo/odoo/service/server.py", line 1198, in preload_registries
registry = Registry.new(dbname, update_module=update_module)
File "/opt/openupgrade/odoo-14/odoo/odoo/modules/registry.py", line 89, in new
odoo.modules.load_modules(registry._db, force_demo, status, update_module)
File "/opt/openupgrade/odoo-14/odoo/odoo/modules/loading.py", line 451, in load_modules
force, status, report, loaded_modules, update_module, models_to_check)
File "/opt/openupgrade/odoo-14/odoo/odoo/modules/loading.py", line 348, in load_marked_modules
perform_checks=perform_checks, models_to_check=models_to_check
File "/opt/openupgrade/odoo-14/odoo/odoo/modules/loading.py", line 198, in load_module_graph
registry.init_models(cr, model_names, {'module': package.name}, new_install)
File "/opt/openupgrade/odoo-14/odoo/odoo/modules/registry.py", line 418, in init_models
self.check_foreign_keys(cr)
File "/opt/openupgrade/odoo-14/odoo/odoo/modules/registry.py", line 496, in check_foreign_keys
sql.add_foreign_key(cr, table1, column1, table2, column2, ondelete)
File "/opt/openupgrade/odoo-14/odoo/odoo/tools/sql.py", line 170, in add_foreign_key
cr.execute(query.format(tablename1, columnname1, tablename2, columnname2, ondelete))
File "", line 2, in execute
File "/opt/openupgrade/odoo-14/odoo/odoo/sql_db.py", line 101, in check
return f(self, *args, **kwargs)
File "/opt/openupgrade/odoo-14/odoo/odoo/sql_db.py", line 298, in execute
res = self._obj.execute(query, params)
psycopg2.errors.UndefinedColumn: column "account_reconcile_model_line_id" referenced in foreign key constraint does not exist
Expected behavior: Expect that it find table "account_reconcile_model_line"
Video/Screenshot link (optional):
The text was updated successfully, but these errors were encountered: