Skip to content
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

[FIX] base_rest: restoring the component_database provoked fails with other modules #497

Merged
merged 1 commit into from
Feb 18, 2025

Conversation

etobella
Copy link
Member

In this case, I found that if we tried to test rest_framework and connector_event at the same time, the following error was raised:

2025-02-14 22:56:45,874 1 CRITICAL devel odoo.service.server: Failed to initialize database `devel`. 
Traceback (most recent call last):
  File "/opt/odoo/custom/src/odoo/odoo/service/server.py", line 1323, 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 87, in new
    odoo.modules.load_modules(registry, force_demo, status, update_module)
  File "/opt/odoo/custom/src/odoo/odoo/modules/loading.py", line 489, in load_modules
    processed_modules += load_marked_modules(cr, graph,
  File "/opt/odoo/custom/src/odoo/odoo/modules/loading.py", line 373, in load_marked_modules
    loaded, processed = load_module_graph(
  File "/opt/odoo/custom/src/odoo/odoo/modules/loading.py", line 305, in load_module_graph
    module.write({'state': 'installed', 'latest_version': ver})
  File "/opt/odoo/auto/addons/component_event/models/base.py", line 112, in write
    self._event("on_record_write").notify(record, fields=fields)
  File "/opt/odoo/auto/addons/component_event/models/base.py", line 70, in _event
    if not comp_registry or not comp_registry.ready:
AttributeError: 'collections.defaultdict' object has no attribute 'ready'

The main reason was to recreate the _component_database with something that we had the copy applied, transforming it to a defaultdict.

@etobella
Copy link
Member Author

@lmignon @sbidoul @simahawk

@lmignon
Copy link
Contributor

lmignon commented Feb 18, 2025

/ocabot merge patch

@OCA-git-bot
Copy link
Contributor

This PR looks fantastic, let's merge it!
Prepared branch 16.0-ocabot-merge-pr-497-by-lmignon-bump-patch, awaiting test results.

@OCA-git-bot
Copy link
Contributor

Congratulations, your PR was merged at 2af1abb. Thanks a lot for contributing to OCA. ❤️

@OCA-git-bot OCA-git-bot merged commit 0de6ed1 into OCA:16.0 Feb 18, 2025
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants