[FIX] base: avoid no autoinstall propagation
A custom script is modifying the output of load_information_from_description_file to disable the auto-install of modules during local testing. It was naively adapted for v16.0 by replacing the corresponding methods. Since a lru cache was added (nice optimization in most cases) this is an issue because running lint test afterward will get the cached value with an incorrect autoinstall value. It makes sens to avoid reading the file on the filesystem each time, but making a deepcopy looks like an acceptable safeguard to avoid hard to debug behaviors. closes odoo/odoo#143628 X-original-commit: ad10ff4410ccf7c38f6154480484495bb57c53ff Signed-off-by: Julien Castiaux (juc) <juc@odoo.com> Signed-off-by: Xavier Dollé (xdo) <xdo@odoo.com>
This commit is contained in:
@@ -312,6 +312,7 @@ def load_manifest(module, mod_path=None):
|
||||
return {}
|
||||
|
||||
manifest = copy.deepcopy(_DEFAULT_MANIFEST)
|
||||
|
||||
manifest['icon'] = get_module_icon(module)
|
||||
|
||||
with tools.file_open(manifest_file, mode='r') as f:
|
||||
@@ -352,7 +353,6 @@ def load_manifest(module, mod_path=None):
|
||||
|
||||
return manifest
|
||||
|
||||
@functools.lru_cache(maxsize=None)
|
||||
def get_manifest(module, mod_path=None):
|
||||
"""
|
||||
Get the module manifest.
|
||||
@@ -365,6 +365,10 @@ def get_manifest(module, mod_path=None):
|
||||
when the manifest was not found.
|
||||
:rtype: dict
|
||||
"""
|
||||
return copy.deepcopy(_get_manifest_cached(module, mod_path))
|
||||
|
||||
@functools.lru_cache(maxsize=None)
|
||||
def _get_manifest_cached(module, mod_path=None):
|
||||
return load_manifest(module, mod_path)
|
||||
|
||||
def load_information_from_description_file(module, mod_path=None):
|
||||
|
||||
Reference in New Issue
Block a user