From c22e8190da2bf05bd4ed8ffebfb3ac8f7b3179e2 Mon Sep 17 00:00:00 2001 From: Vo Minh Thu Date: Mon, 30 Jan 2012 12:31:16 +0100 Subject: [PATCH] [IMP] manifest: still support the old `active` entry (but deprecate it and display a warning). bzr revid: vmt@openerp.com-20120130113116-msjaej7jxp96tbvh --- openerp/modules/module.py | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/openerp/modules/module.py b/openerp/modules/module.py index a731ae63b30..7f59f15a08d 100644 --- a/openerp/modules/module.py +++ b/openerp/modules/module.py @@ -48,6 +48,8 @@ import logging import openerp.modules.db import openerp.modules.graph +_logger = logging.getLogger(__name__) + _ad = os.path.join(os.path.dirname(os.path.dirname(__file__)), 'addons') # default addons path (base) ad_paths = [] @@ -317,7 +319,6 @@ def load_information_from_description_file(module): if os.path.isfile(terp_file) or zipfile.is_zipfile(mod_path+'.zip'): # default values for descriptor info = { - 'active': False, 'application': False, 'author': '', 'category': 'Uncategorized', @@ -343,6 +344,12 @@ def load_information_from_description_file(module): with tools.file_open(terp_file) as terp_f: info.update(eval(terp_f.read())) + if 'active' in info: + _logger.warning('The module `%s` uses the deprecated entry ' + '`active` in its manifest file. It should use the entry ' + '`auto_install`.', module) + info['auto_install'] = info['active'] + return info #TODO: refactor the logger in this file to follow the logging guidelines