From 17160b7fa6a72dc6ae78d36c9177aaa3d8cd47cf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?St=C3=A9phane=20Bidoul?= Date: Wed, 25 Sep 2024 15:31:19 +0200 Subject: [PATCH 1/4] ci: test with Odoo 18 --- .github/workflows/ci.yml | 3 +++ tox.ini | 3 ++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index fa08b77..4e12b34 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -36,6 +36,9 @@ jobs: - python-version: "3.12" toxenv: "py312-17.0" machine: ubuntu-22.04 + - python-version: "3.12" + toxenv: "py312-18.0" + machine: ubuntu-24.04 - python-version: "3.10" toxenv: "twine_check" machine: ubuntu-22.04 diff --git a/tox.ini b/tox.ini index e09b31e..b364d5a 100644 --- a/tox.ini +++ b/tox.ini @@ -5,7 +5,7 @@ [tox] envlist = - py312-{16.0,17.0} + py312-{16.0,17.0,18.0} py310-{16.0,17.0} py38-{15.0} py36-{11.0,12.0,13.0,14.0} @@ -22,6 +22,7 @@ commands = 15.0: {toxinidir}/tests/scripts/install_odoo.py 15.0 {envdir}/src/odoo 16.0: {toxinidir}/tests/scripts/install_odoo.py 16.0 {envdir}/src/odoo 17.0: {toxinidir}/tests/scripts/install_odoo.py 17.0 {envdir}/src/odoo + 18.0: {toxinidir}/tests/scripts/install_odoo.py 18.0 {envdir}/src/odoo master: {toxinidir}/tests/scripts/install_odoo.py master {envdir}/src/odoo pytest --verbose --cov=click_odoo --cov-branch --cov-report=html --cov-report=term --cov-report=xml {posargs} deps = From 709a3acc7526198479e8da2c140c6595e4eafeab Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?St=C3=A9phane=20Bidoul?= Date: Wed, 25 Sep 2024 15:31:46 +0200 Subject: [PATCH 2/4] ci: modernize twine check job --- .github/workflows/ci.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 4e12b34..770041f 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -39,9 +39,9 @@ jobs: - python-version: "3.12" toxenv: "py312-18.0" machine: ubuntu-24.04 - - python-version: "3.10" + - python-version: "3.12" toxenv: "twine_check" - machine: ubuntu-22.04 + machine: ubuntu-24.04 services: postgres: image: postgres:9.6 From 0a7cd2c2fdf03a8d3304f862b57885da0baec248 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?St=C3=A9phane=20Bidoul?= Date: Wed, 25 Sep 2024 20:34:18 +0200 Subject: [PATCH 3/4] ci: use postgres 12 --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 770041f..a1ca9ba 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -44,7 +44,7 @@ jobs: machine: ubuntu-24.04 services: postgres: - image: postgres:9.6 + image: postgres:12 env: POSTGRES_USER: odoo POSTGRES_PASSWORD: odoo From 7e125e7ee9f4abeb03ddf982cb942184ea5715a6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?St=C3=A9phane=20Bidoul?= Date: Wed, 25 Sep 2024 20:51:41 +0200 Subject: [PATCH 4/4] Adapt to Odoo 18 logging config changes --- click_odoo/env_options.py | 5 ++++- tests/test_click_odoo.py | 2 +- 2 files changed, 5 insertions(+), 2 deletions(-) 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):