From 407542b008a40e952dc05344b996483dd08df0f4 Mon Sep 17 00:00:00 2001 From: Christophe Simonis Date: Fri, 22 Sep 2023 12:29:56 +0200 Subject: [PATCH] [FIX] core: harden the legacy `migrations` package matching regex Since odoo/odoo#122569, we now try to import the `migrations` sub-package of each module to find upgrade tests. However, this badly written regex match the OCA module `base_maintenance`, which generate a RecursionError. closes odoo/odoo#136549 X-original-commit: abd9e6686bdb1f84d67bd536d9cecda627cd001a Signed-off-by: Christophe Simonis (chs) --- odoo/modules/module.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/odoo/modules/module.py b/odoo/modules/module.py index 6ce7affeb86..67297f0c154 100644 --- a/odoo/modules/module.py +++ b/odoo/modules/module.py @@ -68,7 +68,7 @@ class UpgradeHook(object): """Makes the legacy `migrations` package being `odoo.upgrade`""" def find_module(self, name, path=None): - if re.match(r"^odoo.addons.base.maintenance.migrations\b", name): + if re.match(r"^odoo\.addons\.base\.maintenance\.migrations\b", name): # We can't trigger a DeprecationWarning in this case. # In order to be cross-versions, the multi-versions upgrade scripts (0.0.0 scripts), # the tests, and the common files (utility functions) still needs to import from the