[FIX] core: no warning in Graph for imported modules
Before this PR, after having imported a module, a warning appears in the log, because it tries to update the graph which does not make sense for an imported module. This commit makes sure the warning is skipped if the module was imported. closes odoo/odoo#155096 Signed-off-by: Christophe Simonis (chs) <chs@odoo.com>
This commit is contained in:
+11
-1
@@ -3,6 +3,7 @@
|
||||
|
||||
""" Modules dependency graph. """
|
||||
|
||||
import functools
|
||||
import itertools
|
||||
import logging
|
||||
|
||||
@@ -11,6 +12,15 @@ import odoo.tools as tools
|
||||
|
||||
_logger = logging.getLogger(__name__)
|
||||
|
||||
|
||||
@functools.lru_cache(maxsize=1)
|
||||
def _ignored_modules(cr):
|
||||
result = ['studio_customization']
|
||||
if tools.sql.column_exists(cr, 'ir_module_module', 'imported'):
|
||||
cr.execute('SELECT name FROM ir_module_module WHERE imported')
|
||||
result += [m[0] for m in cr.fetchall()]
|
||||
return result
|
||||
|
||||
class Graph(dict):
|
||||
""" Modules dependency graph.
|
||||
|
||||
@@ -61,7 +71,7 @@ class Graph(dict):
|
||||
info = odoo.modules.module.get_manifest(module)
|
||||
if info and info['installable']:
|
||||
packages.append((module, info)) # TODO directly a dict, like in get_modules_with_version
|
||||
elif module != 'studio_customization':
|
||||
elif module not in _ignored_modules(cr):
|
||||
_logger.warning('module %s: not installable, skipped', module)
|
||||
|
||||
dependencies = dict([(p, info['depends']) for p, info in packages])
|
||||
|
||||
Reference in New Issue
Block a user