diff --git a/addons/account/tests/test_early_payment_discount.py b/addons/account/tests/test_early_payment_discount.py index 574efb2355c..e91073bdfa3 100644 --- a/addons/account/tests/test_early_payment_discount.py +++ b/addons/account/tests/test_early_payment_discount.py @@ -66,6 +66,8 @@ class TestAccountEarlyPaymentDiscount(AccountTestInvoicingCommon): Ensure that an invoice with an early discount payment term and no invoice date can be previewed or printed. """ + self.registry.enter_test_mode(self.cr) + self.addCleanup(self.registry.leave_test_mode) out_invoice = self.env['account.move'].create([{ 'move_type': 'out_invoice', 'invoice_payment_term_id': self.early_pay_10_percents_10_days.id, diff --git a/odoo/tests/common.py b/odoo/tests/common.py index d70fef9337c..a52c017f13f 100644 --- a/odoo/tests/common.py +++ b/odoo/tests/common.py @@ -750,9 +750,9 @@ class TransactionCase(BaseCase): with cls.registry.cursor() as cr: cls.registry.setup_models(cr) cls.registry.registry_invalidated = False + cls.registry.registry_sequence = cls.registry_start_sequence cls.registry.clear_all_caches() cls.registry.cache_invalidated.clear() - cls.addClassCleanup(reset_changes) cls.cr = cls.registry.cursor()