summaryrefslogtreecommitdiff
path: root/odoo/addons/base/module/module.py
diff options
context:
space:
mode:
authorChristophe Simonis <chs@odoo.com>2017-10-31 15:25:01 +0100
committerChristophe Simonis <chs@odoo.com>2017-10-31 15:25:01 +0100
commit810b6aa7600bad6bba4d0fc67f04ecf4975193d5 (patch)
tree3ae5238cdb4aa22f056c1869fb5766b2b3fe45e8 /odoo/addons/base/module/module.py
parent3c55407f111dcf44fdc0258b2352d208bdc71a0a (diff)
parentd1fcca1504a8a745775487bfd7740505894d2f5f (diff)
[MERGE] forward port branch saas-15 up to d1fcca1504a
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 fde49e72885..3e5e5af2f88 100644
--- a/odoo/addons/base/module/module.py
+++ b/odoo/addons/base/module/module.py
@@ -30,6 +30,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__)
@@ -814,7 +815,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