summaryrefslogtreecommitdiff
path: root/odoo/addons/base/module/module.py
diff options
context:
space:
mode:
authorChristophe Simonis <chs@odoo.com>2017-11-02 13:44:53 +0100
committerChristophe Simonis <chs@odoo.com>2017-11-02 13:44:53 +0100
commit9a32dacd8c30860b24ea191f16f7d0ade6d9c3b2 (patch)
tree6fe30958ff15bbd759563d06f0b6a1813d95247a /odoo/addons/base/module/module.py
parentdafc3fb7928b3e1325d61060f7402fb148675347 (diff)
parentee2b9fae3519c2494f34dacf15d0a3b5bd8fbd06 (diff)
[MERGE] forward port branch 11.0 up to ee2b9fae351
Diffstat (limited to 'odoo/addons/base/module/module.py')
-rw-r--r--odoo/addons/base/module/module.py9
1 files changed, 8 insertions, 1 deletions
diff --git a/odoo/addons/base/module/module.py b/odoo/addons/base/module/module.py
index d28b56584e5..920929a14d2 100644
--- a/odoo/addons/base/module/module.py
+++ b/odoo/addons/base/module/module.py
@@ -26,6 +26,7 @@ import odoo
from odoo import api, fields, models, modules, tools, _
from odoo.exceptions import AccessDenied, UserError
from odoo.tools.parse_version import parse_version
+from odoo.tools.misc import topological_sort
from odoo.http import request
_logger = logging.getLogger(__name__)
@@ -844,7 +845,13 @@ class Module(models.Model):
filter_lang = [lang.code for lang in langs]
elif not isinstance(filter_lang, (list, tuple)):
filter_lang = [filter_lang]
- mod_names = [mod.name for mod in self if mod.state in ('installed', 'to install', 'to upgrade')]
+
+ update_mods = self.filtered(lambda r: r.state in ('installed', 'to install', 'to upgrade'))
+ mod_dict = {
+ mod.name: mod.dependencies_id.mapped('name')
+ for mod in update_mods
+ }
+ mod_names = topological_sort(mod_dict)
self.env['ir.translation'].load_module_terms(mod_names, filter_lang)
@api.multi