diff --git a/click_odoo/env_options.py b/click_odoo/env_options.py index 6b60d56..665f5b1 100644 --- a/click_odoo/env_options.py +++ b/click_odoo/env_options.py @@ -142,7 +142,10 @@ def _configure_odoo(self, ctx): odoo.tools.config["db_name"] = None # see https://github.com/odoo/odoo/commit/b122217f74 odoo.tools.config["load_language"] = None - odoo.tools.config.parse_config(odoo_args) + if odoo.release.version_info >= (18, 0): + odoo.tools.config.parse_config(odoo_args, setup_logging=True) + else: + odoo.tools.config.parse_config(odoo_args) odoo.cli.server.report_configuration() def _db_exists(self, dbname): diff --git a/tests/test_click_odoo.py b/tests/test_click_odoo.py index bd8d973..6037135 100644 --- a/tests/test_click_odoo.py +++ b/tests/test_click_odoo.py @@ -21,7 +21,7 @@ # This hack is necessary because the way CliRunner patches # stdout is not compatible with the Odoo logging initialization # mechanism. Logging is therefore tested with subprocesses. -odoo.netsvc._logger_init = True +odoo.netsvc.init_logger = lambda: None def _init_odoo_db(dbname):