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

website_odoo_debranding: Since Odoo 15.0, Environment.manage() is useless #899

Closed
dhx opened this issue Jun 6, 2022 · 0 comments
Closed
Labels

Comments

@dhx
Copy link

dhx commented Jun 6, 2022

In our 15.0 tests we see this warning:

/usr/lib/python3.8/contextlib.py:113: DeprecationWarning: Since Odoo 15.0, Environment.manage() is useless.
  File "odoo/odoo-bin", line 8, in <module>
    odoo.cli.main()
  File "/data/build/odoo/odoo/cli/command.py", line 61, in main
    o.run(args)
  File "/data/build/odoo/odoo/cli/server.py", line 179, in run
    main(args)
  File "/data/build/odoo/odoo/cli/server.py", line 173, in main
    rc = odoo.service.server.start(preload=preload, stop=stop)
  File "/data/build/odoo/odoo/service/server.py", line 1356, in start
    rc = server.run(preload, stop)
  File "/data/build/odoo/odoo/service/server.py", line 557, in run
    rc = preload_registries(preload)
  File "/data/build/odoo/odoo/service/server.py", line 1260, in preload_registries
    registry = Registry.new(dbname, update_module=update_module)
  File "/data/build/odoo/odoo/modules/registry.py", line 87, in new
    odoo.modules.load_modules(registry, force_demo, status, update_module)
  File "/data/build/odoo/odoo/modules/loading.py", line 474, in load_modules
    processed_modules += load_marked_modules(cr, graph,
  File "/data/build/odoo/odoo/modules/loading.py", line 363, in load_marked_modules
    loaded, processed = load_module_graph(
  File "/data/build/odoo/odoo/modules/loading.py", line 240, in load_module_graph
    getattr(py_module, post_init)(cr, registry)
  File "/data/build/addons-oca/addons/website_odoo_debranding/hooks.py", line 17, in post_init_hook
    with api.Environment.manage():
  File "/usr/lib/python3.8/contextlib.py", line 113, in __enter__
    return next(self.gen)

which seems to be triggered by:

https://github.com/OCA/website/blob/15.0/website_odoo_debranding/hooks.py#L17

Related to #898

@dhx dhx added the bug label Jun 6, 2022
dhx added a commit to cibex/website that referenced this issue Jun 6, 2022
dhx added a commit to cibex/website that referenced this issue Jun 6, 2022
yibudak pushed a commit to yibudak/website that referenced this issue Oct 28, 2022
yibudak pushed a commit to yibudak/website that referenced this issue Oct 28, 2022
NICO-SOLUTIONS pushed a commit to NICO-SOLUTIONS/website that referenced this issue Nov 12, 2023
NICO-SOLUTIONS pushed a commit to NICO-SOLUTIONS/website that referenced this issue Jan 30, 2024
NICO-SOLUTIONS pushed a commit to NICO-SOLUTIONS/website that referenced this issue Mar 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants