diff --git a/account_financial_report/tests/test_aged_partner_balance.py b/account_financial_report/tests/test_aged_partner_balance.py index b1c0e6ca5c2..69b86806885 100644 --- a/account_financial_report/tests/test_aged_partner_balance.py +++ b/account_financial_report/tests/test_aged_partner_balance.py @@ -6,9 +6,20 @@ class TestAgedPartnerBalance(TransactionCase): - def setUp(self): - super().setUp() - self.wizard_model = self.env["aged.partner.balance.report.wizard"] + @classmethod + def setUpClass(cls): + super().setUpClass() + cls.env = cls.env( + context=dict( + cls.env.context, + mail_create_nolog=True, + mail_create_nosubscribe=True, + mail_notrack=True, + no_reset_password=True, + tracking_disable=True, + ) + ) + cls.wizard_model = cls.env["aged.partner.balance.report.wizard"] def test_report(self): """Check that report is produced correctly.""" diff --git a/account_financial_report/tests/test_general_ledger.py b/account_financial_report/tests/test_general_ledger.py index c8a2aa70743..2e9187bc46a 100644 --- a/account_financial_report/tests/test_general_ledger.py +++ b/account_financial_report/tests/test_general_ledger.py @@ -17,6 +17,16 @@ class TestGeneralLedgerReport(AccountTestInvoicingCommon): @classmethod def setUpClass(cls, chart_template_ref=None): super().setUpClass(chart_template_ref=chart_template_ref) + cls.env = cls.env( + context=dict( + cls.env.context, + mail_create_nolog=True, + mail_create_nosubscribe=True, + mail_notrack=True, + no_reset_password=True, + tracking_disable=True, + ) + ) cls.before_previous_fy_year = fields.Date.from_string("2014-05-05") cls.previous_fy_date_start = fields.Date.from_string("2015-01-01") cls.previous_fy_date_end = fields.Date.from_string("2015-12-31") diff --git a/account_financial_report/tests/test_journal_ledger.py b/account_financial_report/tests/test_journal_ledger.py index 62b56e5e2c0..bd34393221f 100644 --- a/account_financial_report/tests/test_journal_ledger.py +++ b/account_financial_report/tests/test_journal_ledger.py @@ -18,6 +18,16 @@ class TestJournalReport(AccountTestInvoicingCommon): @classmethod def setUpClass(cls, chart_template_ref=None): super().setUpClass(chart_template_ref=chart_template_ref) + cls.env = cls.env( + context=dict( + cls.env.context, + mail_create_nolog=True, + mail_create_nosubscribe=True, + mail_notrack=True, + no_reset_password=True, + tracking_disable=True, + ) + ) cls.AccountObj = cls.env["account.account"] cls.InvoiceObj = cls.env["account.move"] cls.JournalObj = cls.env["account.journal"] diff --git a/account_financial_report/tests/test_open_items.py b/account_financial_report/tests/test_open_items.py index b490ca0e1df..532d896e022 100644 --- a/account_financial_report/tests/test_open_items.py +++ b/account_financial_report/tests/test_open_items.py @@ -12,6 +12,16 @@ class TestOpenItems(AccountTestInvoicingCommon): @classmethod def setUpClass(cls, chart_template_ref=None): super().setUpClass(chart_template_ref=chart_template_ref) + cls.env = cls.env( + context=dict( + cls.env.context, + mail_create_nolog=True, + mail_create_nosubscribe=True, + mail_notrack=True, + no_reset_password=True, + tracking_disable=True, + ) + ) def test_partner_filter(self): partner_1 = self.env.ref("base.res_partner_1") diff --git a/account_financial_report/tests/test_trial_balance.py b/account_financial_report/tests/test_trial_balance.py index 37d713b0e95..8128267b83a 100644 --- a/account_financial_report/tests/test_trial_balance.py +++ b/account_financial_report/tests/test_trial_balance.py @@ -13,6 +13,16 @@ class TestTrialBalanceReport(AccountTestInvoicingCommon): @classmethod def setUpClass(cls, chart_template_ref=None): super().setUpClass(chart_template_ref=chart_template_ref) + cls.env = cls.env( + context=dict( + cls.env.context, + mail_create_nolog=True, + mail_create_nosubscribe=True, + mail_notrack=True, + no_reset_password=True, + tracking_disable=True, + ) + ) # Remove previous account groups and related invoices to avoid conflicts group_obj = cls.env["account.group"] cls.group1 = group_obj.create({"code_prefix_start": "1", "name": "Group 1"}) diff --git a/account_financial_report/tests/test_vat_report.py b/account_financial_report/tests/test_vat_report.py index 91776af17f2..04cb9a5b261 100644 --- a/account_financial_report/tests/test_vat_report.py +++ b/account_financial_report/tests/test_vat_report.py @@ -49,6 +49,16 @@ def init_invoice( @classmethod def setUpClass(cls, chart_template_ref=None): super().setUpClass(chart_template_ref=chart_template_ref) + cls.env = cls.env( + context=dict( + cls.env.context, + mail_create_nolog=True, + mail_create_nosubscribe=True, + mail_notrack=True, + no_reset_password=True, + tracking_disable=True, + ) + ) cls.date_from = time.strftime("%Y-%m-01") cls.date_to = time.strftime("%Y-%m-28") cls.company = cls.env.user.company_id diff --git a/account_tax_balance/tests/test_account_tax_balance.py b/account_tax_balance/tests/test_account_tax_balance.py index 96a639ff169..e0025f6c270 100644 --- a/account_tax_balance/tests/test_account_tax_balance.py +++ b/account_tax_balance/tests/test_account_tax_balance.py @@ -17,28 +17,39 @@ @odoo.tests.tagged("post_install", "-at_install") class TestAccountTaxBalance(HttpCase): - def setUp(self): - super().setUp() - self.env.user.groups_id = [(4, self.env.ref("account.group_account_user").id)] - self.company = self.env.user.company_id - self.range_type = self.env["date.range.type"].create( + @classmethod + def setUpClass(cls): + super().setUpClass() + cls.env = cls.env( + context=dict( + cls.env.context, + mail_create_nolog=True, + mail_create_nosubscribe=True, + mail_notrack=True, + no_reset_password=True, + tracking_disable=True, + ) + ) + cls.env.user.groups_id = [(4, cls.env.ref("account.group_account_user").id)] + cls.company = cls.env.user.company_id + cls.range_type = cls.env["date.range.type"].create( {"name": "Fiscal year", "allow_overlap": False} ) - self.range_generator = self.env["date.range.generator"] - self.current_year = datetime.now().year - self.current_month = datetime.now().month - range_generator = self.range_generator.create( + cls.range_generator = cls.env["date.range.generator"] + cls.current_year = datetime.now().year + cls.current_month = datetime.now().month + range_generator = cls.range_generator.create( { - "date_start": "%s-01-01" % self.current_year, - "name_prefix": "%s-" % self.current_year, - "type_id": self.range_type.id, + "date_start": "%s-01-01" % cls.current_year, + "name_prefix": "%s-" % cls.current_year, + "type_id": cls.range_type.id, "duration_count": 1, "unit_of_time": str(MONTHLY), "count": 12, } ) range_generator.action_apply() - self.range = self.env["date.range"] + cls.range = cls.env["date.range"] def test_tax_balance(self): previous_taxes_ids = (