diff --git a/anthem/cli.py b/anthem/cli.py index 1a7e601..77f4e65 100644 --- a/anthem/cli.py +++ b/anthem/cli.py @@ -77,8 +77,13 @@ def __exit__(self, exc_type, exc_value, traceback): def _build_odoo_env(self, odoo_args): openerp.tools.config.parse_config(odoo_args) - openerp.service.server.start(preload=[], stop=True) dbname = openerp.tools.config['db_name'] + if not dbname: + argparse.ArgumentParser().error( + "please provide a database name though Odoo options (either " + "-d or an Odoo configuration file)" + ) + openerp.service.server.start(preload=[], stop=True) registry = openerp.modules.registry.RegistryManager.get(dbname) cr = registry.cursor()