[FIX] base: python 2.6 incompatibility for dictionary comprehension
authorMartin Ambroz <martin@its.mu>
Wed, 20 Aug 2014 04:42:19 +0000 (08:42 +0400)
committerMartin Trigaux <mat@openerp.com>
Wed, 20 Aug 2014 08:28:37 +0000 (10:28 +0200)
openerp/osv/fields.py
openerp/tools/translate.py

index ee0ea8f..9ee0c8d 100644 (file)
@@ -1145,9 +1145,9 @@ class function(_column):
         # if we already have a value, don't recompute it.
         # This happen if case of stored many2one fields
         if values and not multi and name in values[0]:
-            result = {v['id']: v[name] for v in values}
+            result = dict((v['id'], v[name]) for v in values)
         elif values and multi and all(n in values[0] for n in name):
-            result = {v['id']: dict((n, v[n]) for n in name) for v in values}
+            result = dict((v['id'], dict((n, v[n]) for n in name)) for v in values)
         else:
             result = self._fnct(obj, cr, uid, ids, name, self._arg, context)
         for id in ids:
index 721fb47..ac01162 100644 (file)
@@ -830,7 +830,7 @@ def trans_generate(lang, modules, cr):
     def get_module_paths():
         # default addons path (base)
         def_path = os.path.abspath(os.path.join(config.config['root_path'], 'addons'))
-        mod_paths = { def_path }
+        mod_paths = set([ def_path ])
         ad_paths = map(lambda m: os.path.abspath(m.strip()),config.config['addons_path'].split(','))
         for adp in ad_paths:
             mod_paths.add(adp)
@@ -838,7 +838,7 @@ def trans_generate(lang, modules, cr):
                 mod_paths.add(adp)
             elif adp != def_path and adp.startswith(def_path):
                 mod_paths.add(adp[len(def_path)+1:])
-        return mod_paths
+        return list(mod_paths)
 
     def get_module_from_path(path, mod_paths):
         for mp in mod_paths: