Skip to content

Commit

Permalink
Adapt to Odoo 18 logging config changes
Browse files Browse the repository at this point in the history
  • Loading branch information
sbidoul committed Oct 23, 2024
1 parent 0a7cd2c commit 7e125e7
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
5 changes: 4 additions & 1 deletion click_odoo/env_options.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand Down
2 changes: 1 addition & 1 deletion tests/test_click_odoo.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand Down

0 comments on commit 7e125e7

Please sign in to comment.