While attempting a migration from Odoo 14.0 to 18.0 using OpenUpgrade, the process fails during the phase 16.0 to 17.0, during the module loading phase due to a missing system parameter: analytic.project_plan.
The migration is being performed using the official OpenUpgrade migration scripts. These scripts correctly create the analytic.project_plan configuration parameter:
However, the error occurs before these scripts are executed. The registry fails to initialize when the system attempts to load the analytic_data.xml file and create the analytic_plan_projects record. During the creation, it calls methods that depend on analytic.project_plan, which is not yet defined in the system parameters at this point in the migration process.
2025-09-26 12:03:37,143 1 ERROR ou17 odoo.modules.registry: Failed to load registry
Traceback (most recent call last):
File "/opt/odoo/custom/src/odoo/odoo/tools/cache.py", line 99, in lookup
r = d[key]
File "<decorator-gen-5>", line 2, in __getitem__
File "/opt/odoo/custom/src/odoo/odoo/tools/func.py", line 87, in locked
return func(inst, *args, **kwargs)
File "/opt/odoo/custom/src/odoo/odoo/tools/lru.py", line 34, in __getitem__
a = self.d[obj]
KeyError: ('account.analytic.plan', <function AccountAnalyticPlan.__get_all_plans at 0x7afa1d9cc9d0>)
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/opt/odoo/custom/src/odoo/odoo/tools/convert.py", line 556, in _tag_root
f(rec)
File "/opt/odoo/custom/src/odoo/odoo/tools/convert.py", line 456, in _tag_record
record = model._load_records([data], self.mode == 'update')
File "/opt/odoo/custom/src/odoo/odoo/models.py", line 5088, in _load_records
records = self._load_records_create([data['values'] for data in to_create])
File "/opt/odoo/custom/src/odoo/odoo/models.py", line 4999, in _load_records_create
return self.create(values)
File "<decorator-gen-12>", line 2, in create
File "/opt/odoo/custom/src/odoo/odoo/api.py", line 415, in _model_create_multi
return create(self, arg)
File "/opt/odoo/custom/src/odoo/odoo/models.py", line 4658, in create
next(iter(fields)).determine_inverse(batch_recs)
File "/opt/odoo/custom/src/odoo/odoo/fields.py", line 1398, in determine_inverse
determine(self.inverse, records)
File "/opt/odoo/custom/src/odoo/odoo/fields.py", line 102, in determine
return needle(*args)
File "/opt/odoo/auto/addons/analytic/models/analytic_plan.py", line 125, in _inverse_name
self._sync_plan_column()
File "/opt/odoo/auto/addons/analytic/models/analytic_plan.py", line 262, in _sync_plan_column
prev = plan._find_plan_column()
File "/opt/odoo/auto/addons/analytic/models/analytic_plan.py", line 255, in _find_plan_column
('name', 'in', [plan._strict_column_name() for plan in self]),
File "/opt/odoo/auto/addons/analytic/models/analytic_plan.py", line 255, in <listcomp>
('name', 'in', [plan._strict_column_name() for plan in self]),
File "/opt/odoo/auto/addons/analytic/models/analytic_plan.py", line 118, in _strict_column_name
project_plan, _other_plans = self._get_all_plans()
File "/opt/odoo/auto/addons/analytic/models/analytic_plan.py", line 114, in _get_all_plans
return map(self.browse, self.__get_all_plans())
File "<decorator-gen-159>", line 2, in __get_all_plans
File "/opt/odoo/custom/src/odoo/odoo/tools/cache.py", line 104, in lookup
value = d[key] = self.method(*args, **kwargs)
File "/opt/odoo/auto/addons/analytic/models/analytic_plan.py", line 109, in __get_all_plans
raise UserError(_("A 'Project' plan needs to exist and its id needs to be set as `analytic.project_plan` in the system variables"))
odoo.exceptions.UserError: A 'Project' plan needs to exist and its id needs to be set as `analytic.project_plan` in the system variables
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "/opt/odoo/custom/src/odoo/odoo/modules/registry.py", line 114, in new
odoo.modules.load_modules(registry, force_demo, status, update_module)
File "/opt/odoo/custom/src/odoo/odoo/modules/loading.py", line 476, in load_modules
processed_modules += load_marked_modules(env, graph,
File "/opt/odoo/custom/src/odoo/odoo/modules/loading.py", line 364, in load_marked_modules
loaded, processed = load_module_graph(
File "/opt/odoo/custom/src/odoo/odoo/modules/loading.py", line 227, in load_module_graph
load_data(env, idref, mode, kind='data', package=package)
File "/opt/odoo/custom/src/odoo/odoo/modules/loading.py", line 71, in load_data
tools.convert_file(env, package.name, filename, idref, mode, noupdate, kind)
File "/opt/odoo/custom/src/odoo/odoo/tools/convert.py", line 627, in convert_file
convert_xml_import(env, module, fp, idref, mode, noupdate)
File "/opt/odoo/custom/src/odoo/odoo/tools/convert.py", line 693, in convert_xml_import
obj.parse(doc.getroot())
File "/opt/odoo/custom/src/odoo/odoo/tools/convert.py", line 613, in parse
self._tag_root(de)
File "/opt/odoo/custom/src/odoo/odoo/tools/convert.py", line 556, in _tag_root
f(rec)
File "/opt/odoo/custom/src/odoo/odoo/tools/convert.py", line 569, in _tag_root
raise ParseError('while parsing %s:%s, somewhere inside\n%s' % (
odoo.tools.convert.ParseError: while parsing /opt/odoo/auto/addons/analytic/data/analytic_data.xml:14, somewhere inside
<record id="analytic_plan_projects" model="account.analytic.plan">
<field name="name">Projects</field>
<field name="default_applicability">optional</field>
</record>
2025-09-26 12:03:37,146 1 CRITICAL ou17 odoo.service.server: Failed to initialize database `ou17`.
Traceback (most recent call last):
File "/opt/odoo/custom/src/odoo/odoo/tools/cache.py", line 99, in lookup
r = d[key]
File "<decorator-gen-5>", line 2, in __getitem__
File "/opt/odoo/custom/src/odoo/odoo/tools/func.py", line 87, in locked
return func(inst, *args, **kwargs)
File "/opt/odoo/custom/src/odoo/odoo/tools/lru.py", line 34, in __getitem__
a = self.d[obj]
KeyError: ('account.analytic.plan', <function AccountAnalyticPlan.__get_all_plans at 0x7afa1d9cc9d0>)
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/opt/odoo/custom/src/odoo/odoo/tools/convert.py", line 556, in _tag_root
f(rec)
File "/opt/odoo/custom/src/odoo/odoo/tools/convert.py", line 456, in _tag_record
record = model._load_records([data], self.mode == 'update')
File "/opt/odoo/custom/src/odoo/odoo/models.py", line 5088, in _load_records
records = self._load_records_create([data['values'] for data in to_create])
File "/opt/odoo/custom/src/odoo/odoo/models.py", line 4999, in _load_records_create
return self.create(values)
File "<decorator-gen-12>", line 2, in create
File "/opt/odoo/custom/src/odoo/odoo/api.py", line 415, in _model_create_multi
return create(self, arg)
File "/opt/odoo/custom/src/odoo/odoo/models.py", line 4658, in create
next(iter(fields)).determine_inverse(batch_recs)
File "/opt/odoo/custom/src/odoo/odoo/fields.py", line 1398, in determine_inverse
determine(self.inverse, records)
File "/opt/odoo/custom/src/odoo/odoo/fields.py", line 102, in determine
return needle(*args)
File "/opt/odoo/auto/addons/analytic/models/analytic_plan.py", line 125, in _inverse_name
self._sync_plan_column()
File "/opt/odoo/auto/addons/analytic/models/analytic_plan.py", line 262, in _sync_plan_column
prev = plan._find_plan_column()
File "/opt/odoo/auto/addons/analytic/models/analytic_plan.py", line 255, in _find_plan_column
('name', 'in', [plan._strict_column_name() for plan in self]),
File "/opt/odoo/auto/addons/analytic/models/analytic_plan.py", line 255, in <listcomp>
('name', 'in', [plan._strict_column_name() for plan in self]),
File "/opt/odoo/auto/addons/analytic/models/analytic_plan.py", line 118, in _strict_column_name
project_plan, _other_plans = self._get_all_plans()
File "/opt/odoo/auto/addons/analytic/models/analytic_plan.py", line 114, in _get_all_plans
return map(self.browse, self.__get_all_plans())
File "<decorator-gen-159>", line 2, in __get_all_plans
File "/opt/odoo/custom/src/odoo/odoo/tools/cache.py", line 104, in lookup
value = d[key] = self.method(*args, **kwargs)
File "/opt/odoo/auto/addons/analytic/models/analytic_plan.py", line 109, in __get_all_plans
raise UserError(_("A 'Project' plan needs to exist and its id needs to be set as `analytic.project_plan` in the system variables"))
odoo.exceptions.UserError: A 'Project' plan needs to exist and its id needs to be set as `analytic.project_plan` in the system variables
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "/opt/odoo/custom/src/odoo/odoo/service/server.py", line 1313, in preload_registries
registry = Registry.new(dbname, update_module=update_module)
File "<decorator-gen-16>", line 2, in new
File "/opt/odoo/custom/src/odoo/odoo/tools/func.py", line 87, in locked
return func(inst, *args, **kwargs)
File "/opt/odoo/custom/src/odoo/odoo/modules/registry.py", line 114, in new
odoo.modules.load_modules(registry, force_demo, status, update_module)
File "/opt/odoo/custom/src/odoo/odoo/modules/loading.py", line 476, in load_modules
processed_modules += load_marked_modules(env, graph,
File "/opt/odoo/custom/src/odoo/odoo/modules/loading.py", line 364, in load_marked_modules
loaded, processed = load_module_graph(
File "/opt/odoo/custom/src/odoo/odoo/modules/loading.py", line 227, in load_module_graph
load_data(env, idref, mode, kind='data', package=package)
File "/opt/odoo/custom/src/odoo/odoo/modules/loading.py", line 71, in load_data
tools.convert_file(env, package.name, filename, idref, mode, noupdate, kind)
File "/opt/odoo/custom/src/odoo/odoo/tools/convert.py", line 627, in convert_file
convert_xml_import(env, module, fp, idref, mode, noupdate)
File "/opt/odoo/custom/src/odoo/odoo/tools/convert.py", line 693, in convert_xml_import
obj.parse(doc.getroot())
File "/opt/odoo/custom/src/odoo/odoo/tools/convert.py", line 613, in parse
self._tag_root(de)
File "/opt/odoo/custom/src/odoo/odoo/tools/convert.py", line 556, in _tag_root
f(rec)
File "/opt/odoo/custom/src/odoo/odoo/tools/convert.py", line 569, in _tag_root
raise ParseError('while parsing %s:%s, somewhere inside\n%s' % (
odoo.tools.convert.ParseError: while parsing /opt/odoo/auto/addons/analytic/data/analytic_data.xml:14, somewhere inside
<record id="analytic_plan_projects" model="account.analytic.plan">
<field name="name">Projects</field>
<field name="default_applicability">optional</field>
</record>
Module
analytic and project
Bug description
While attempting a migration from Odoo 14.0 to 18.0 using OpenUpgrade, the process fails during the phase 16.0 to 17.0, during the module loading phase due to a missing system parameter:
analytic.project_plan.The issue originates from the core analytic module in Odoo 17, where the data file
analytic_data.xmldefines a record for theaccount.analytic.planmodel. This triggers model logic that expects theanalytic.project_plansystem parameter to already exist — which it does not at this point.The migration is being performed using the official OpenUpgrade migration scripts. These scripts correctly create the
analytic.project_planconfiguration parameter:However, the error occurs before these scripts are executed. The registry fails to initialize when the system attempts to load the
analytic_data.xmlfile and create theanalytic_plan_projectsrecord. During the creation, it calls methods that depend onanalytic.project_plan, which is not yet defined in the system parameters at this point in the migration process.This causes the migration to fail before any of the
pre-migration.pyscripts are even reached, making it impossible to let OpenUpgrade handle the parameter creation as intended.Error Logs
To Reproduce
Affected versions: 16.0, 17.0
Steps to reproduce the behavior:
Expected behavior
Migration goes smoothly.