diff --git a/bin/addons/__init__.py b/bin/addons/__init__.py index 114b4ceb423..b147db854ef 100644 --- a/bin/addons/__init__.py +++ b/bin/addons/__init__.py @@ -320,6 +320,7 @@ def upgrade_graph(graph, cr, module_list, force=None): mod_path = get_module_path(module) terp_file = get_module_resource(module, '__terp__.py') if not mod_path or not terp_file: + global not_loaded not_loaded.append(module) logger.notifyChannel('init', netsvc.LOG_WARNING, 'module %s: not installable' % (module)) raise osv.osv.except_osv('Error!',"Module '%s' was not found" % (module,)) @@ -710,8 +711,11 @@ def load_modules(db, force_demo=False, status=None, update_module=False): graph = create_graph(cr, ['base'], force) has_updates = load_module_graph(cr, graph, status, perform_checks=(not update_module), report=report) + + global not_loaded if not_loaded: #If some module is not loaded don't proceed further + not_loaded = [] return if update_module: modobj = pool.get('ir.module.module') diff --git a/bin/tools/config.py b/bin/tools/config.py index 5cc32747b08..68fd732090f 100644 --- a/bin/tools/config.py +++ b/bin/tools/config.py @@ -347,6 +347,18 @@ class configmanager(object): res = os.path.abspath(os.path.expanduser(value)) if not os.path.exists(res): raise optparse.OptionValueError("option %s: no such directory: %r" % (opt, value)) + + contains_addons = False + for f in os.listdir(res): + modpath = os.path.join(res, f) + if os.path.isdir(modpath) and os.path.exists(os.path.join(modpath, '__init__.py')) and \ + os.path.exists(os.path.join(modpath, '__terp__.py')): + contains_addons = True + break + + if not contains_addons: + raise optparse.OptionValueError("option %s: The addons-path %r does not seem to a be a valid Addons Directory!" % (opt, value)) + setattr(parser.values, option.dest, res) def load(self):