The http.addons_manifest is a map {module: manifest_dict} that is
populated upon the first http request. This map is basically a module
manifest cache with an extra `addons_path` key, the path of the module
on the file-system. This cache is eagerly populated upon the first http
request, the map is empty in non-http contextes (e.g. cron) which have
been a source of bugs (e.g. 50c8eb1).
A manifest cache is necessary because reading and parsing python files
from the file-system is not that cheap but there is no reason that cache
is located in `odoo.http`. A thin cache layer now wraps
`load_information_from_description_file()`/`load_manifest()` and is
lazily populated.
The `http.addons_manifest` have been removed. The extra `addons_path`
key is now present in the "normal" manifest. The `read_manifest()` was
hardly used so it has been deprecated. The only way to retrieve a
manifest is now `load_information_from_description_file()` which was
renamed `load_manifest()` (no cache) and `get_manifest()` (cache).
Side note about performances, the cache is necessary. Addons manifest
are read-only and reading + parsing python files from the file system is
not a cheap operation. Running the e-commerce tour
`@website_sale.test_04_admin_website_sale_tour` without cache on
`load_manifest()` requires 68,29 secs to complete on my laptop,
exceeding the default 1-minute time frame allowed in tests. Using a
cache the time is down to 36,53 secs. The performance impact is huge.
Part-of: odoo/odoo#79977
25 lines
574 B
Python
25 lines
574 B
Python
# -*- coding: utf-8 -*-
|
|
# Part of Odoo. See LICENSE file for full copyright and licensing details.
|
|
|
|
""" Modules (also called addons) management.
|
|
|
|
"""
|
|
|
|
from . import db, graph, loading, migration, module, registry
|
|
|
|
from odoo.modules.loading import load_modules, reset_modules_state
|
|
|
|
from odoo.modules.module import (
|
|
adapt_version,
|
|
get_module_path,
|
|
get_module_resource,
|
|
get_modules,
|
|
get_modules_with_version,
|
|
get_resource_from_path,
|
|
get_resource_path,
|
|
check_resource_path,
|
|
initialize_sys_path,
|
|
get_manifest,
|
|
load_openerp_module,
|
|
)
|