summaryrefslogtreecommitdiff
path: root/odoo/modules/graph.py
diff options
context:
space:
mode:
authorChristophe Simonis <chs@odoo.com>2017-08-24 13:17:53 +0200
committerChristophe Simonis <chs@odoo.com>2017-08-24 13:17:53 +0200
commit017ee5eab376b4f09beb62812c1cbc682009ed86 (patch)
tree2af185b0604cd8ce9129c39137bbf39d21d7be89 /odoo/modules/graph.py
parent006c16198f7f68c9dc8b895defd013f33008840a (diff)
parent877e7098719195ed2934fc9c3b5c3bd8ad8bab07 (diff)
[MERGE] forward port branch saas-17 up to 877e7098719
Diffstat (limited to 'odoo/modules/graph.py')
-rw-r--r--odoo/modules/graph.py11
1 files changed, 5 insertions, 6 deletions
diff --git a/odoo/modules/graph.py b/odoo/modules/graph.py
index 731b6f6557a..0f2e329fab9 100644
--- a/odoo/modules/graph.py
+++ b/odoo/modules/graph.py
@@ -8,7 +8,6 @@ import logging
import odoo
import odoo.tools as tools
-from odoo.tools import pycompat
_logger = logging.getLogger(__name__)
@@ -36,7 +35,7 @@ class Graph(dict):
return
# update the graph with values from the database (if exist)
## First, we set the default values for each package in graph
- additional_data = {key: {'id': 0, 'state': 'uninstalled', 'dbdemo': False, 'installed_version': None} for key in pycompat.keys(self)}
+ additional_data = {key: {'id': 0, 'state': 'uninstalled', 'dbdemo': False, 'installed_version': None} for key in self.keys()}
## Then we get the values from the database
cr.execute('SELECT name, id, state, demo AS dbdemo, latest_version AS installed_version'
' FROM ir_module_module'
@@ -46,8 +45,8 @@ class Graph(dict):
## and we update the default values with values from the database
additional_data.update((x['name'], x) for x in cr.dictfetchall())
- for package in pycompat.values(self):
- for k, v in pycompat.items(additional_data[package.name]):
+ for package in self.values():
+ for k, v in additional_data[package.name].items():
setattr(package, k, v)
def add_module(self, cr, module, force=None):
@@ -102,9 +101,9 @@ class Graph(dict):
def __iter__(self):
level = 0
- done = set(pycompat.keys(self))
+ done = set(self.keys())
while done:
- level_modules = sorted((name, module) for name, module in pycompat.items(self) if module.depth==level)
+ level_modules = sorted((name, module) for name, module in self.items() if module.depth==level)
for name, module in level_modules:
done.remove(name)
yield module