From 00c82d3121bc28c4902f8f084d2bb2807350c560 Mon Sep 17 00:00:00 2001 From: Adrian Torres Date: Tue, 7 Apr 2020 11:55:28 +0000 Subject: [PATCH] [FIX] account: ensure cleanup of registry after test_all_l10n Followup of #48896, ensures that the registry is correctly cleaned up after the installation of the different l10n_* modules and that the subsequent setup_models is done with the correct registry closes odoo/odoo#49197 X-original-commit: bfd6bdcd89724f04442bbe07307177c523bed5f0 Signed-off-by: Raphael Collet (rco) --- addons/account/tests/test_account_all_l10n.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/addons/account/tests/test_account_all_l10n.py b/addons/account/tests/test_account_all_l10n.py index 154c4828268..533dba0f414 100644 --- a/addons/account/tests/test_account_all_l10n.py +++ b/addons/account/tests/test_account_all_l10n.py @@ -20,6 +20,13 @@ class TestAllL10n(SingleTransactionCase): @classmethod def setUpClass(cls): super(TestAllL10n, cls).setUpClass() + + # the installation of l10n_* modules below instanciates a NEW registry, so we + # have to restore the old one in order to perform the cleanups + @cls.addClassCleanup + def cleanup(): + cls.registry.registries[cls.registry.db_name] = cls.registry + l10n_mods = cls.env['ir.module.module'].search([ ('name', 'like', 'l10n%'), ('state', '=', 'uninstalled'),