From 392aa29943e0fb7795711f1be7be541932974abf Mon Sep 17 00:00:00 2001 From: Quentin Groulard Date: Fri, 20 Sep 2024 10:14:33 +0200 Subject: [PATCH] Replace deprecated odoo.registry() As of Odoo 18, odoo.registry is deprecated. See https://github.com/odoo/odoo/commit/447b35548dc5d6526885eb4f2397d7a0dca22521 --- click_odoo/env.py | 2 +- newsfragments/60.feature | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) create mode 100644 newsfragments/60.feature diff --git a/click_odoo/env.py b/click_odoo/env.py index f85aefe..83b2c30 100644 --- a/click_odoo/env.py +++ b/click_odoo/env.py @@ -12,7 +12,7 @@ @contextmanager def OdooEnvironment(database, rollback=False, **kwargs): with environment_manage(): - registry = odoo.registry(database) + registry = odoo.modules.registry.Registry(database) try: with registry.cursor() as cr: uid = odoo.SUPERUSER_ID diff --git a/newsfragments/60.feature b/newsfragments/60.feature new file mode 100644 index 0000000..3329680 --- /dev/null +++ b/newsfragments/60.feature @@ -0,0 +1 @@ +Use ``odoo.modules.registry.Registry()`` instead of the now deprecated `odoo.registry()`.