diff options
| author | Frédéric van der Essen <fva@openerp.com> | 2012-12-28 13:28:04 +0100 |
|---|---|---|
| committer | Frédéric van der Essen <fva@openerp.com> | 2012-12-28 13:28:04 +0100 |
| commit | 0eac2ff48e8c64883bd4d6b5620547b575461bbe (patch) | |
| tree | 4ab67c3d68d6d13cbb30028ef0b2a8e23be7902e /openerp/modules/module.py | |
| parent | faa67b8411b9998798db8119df3446f51954c81b (diff) | |
| parent | e3d2c92fc689ab26f900f0ed545b19a0af477afb (diff) | |
[MERGE] from upstream
bzr revid: fva@openerp.com-20121228122804-c4t1z7x0zy2nyif0
Diffstat (limited to 'openerp/modules/module.py')
| -rw-r--r-- | openerp/modules/module.py | 18 |
1 files changed, 13 insertions, 5 deletions
diff --git a/openerp/modules/module.py b/openerp/modules/module.py index bb4ff481fb9..98955aff492 100644 --- a/openerp/modules/module.py +++ b/openerp/modules/module.py @@ -3,7 +3,7 @@ # # OpenERP, Open Source Management Solution # Copyright (C) 2004-2009 Tiny SPRL (<http://tiny.be>). -# Copyright (C) 2010-2011 OpenERP s.a. (<http://openerp.com>). +# Copyright (C) 2010-2012 OpenERP s.a. (<http://openerp.com>). # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as @@ -329,7 +329,7 @@ def load_information_from_description_file(module): 'license': 'AGPL-3', 'name': False, 'post_load': None, - 'version': '0.0.0', + 'version': '1.0', 'web': False, 'website': '', 'sequence': 100, @@ -349,6 +349,7 @@ def load_information_from_description_file(module): # 'active' has been renamed 'auto_install' info['auto_install'] = info['active'] + info['version'] = adapt_version(info['version']) return info #TODO: refactor the logger in this file to follow the logging guidelines @@ -447,15 +448,22 @@ def get_modules(): def get_modules_with_version(): modules = get_modules() - res = {} + res = dict.fromkeys(modules, adapt_version('1.0')) for module in modules: try: info = load_information_from_description_file(module) - res[module] = "%s.%s" % (release.major_version, info['version']) - except Exception, e: + res[module] = info['version'] + except Exception: continue return res +def adapt_version(version): + serie = release.major_version + if version == serie or not version.startswith(serie + '.'): + version = '%s.%s' % (serie, version) + return version + + def get_test_modules(module, submodule, explode): """ Return a list of submodules containing tests. |
