summaryrefslogtreecommitdiff
path: root/openerp/modules/module.py
diff options
context:
space:
mode:
Diffstat (limited to 'openerp/modules/module.py')
-rw-r--r--openerp/modules/module.py18
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.