diff --git a/account_bank_statement_reopen_skip_undo_reconciliation/tests/test_account_bank_statement.py b/account_bank_statement_reopen_skip_undo_reconciliation/tests/test_account_bank_statement.py index 539aefd7..7e6f1609 100644 --- a/account_bank_statement_reopen_skip_undo_reconciliation/tests/test_account_bank_statement.py +++ b/account_bank_statement_reopen_skip_undo_reconciliation/tests/test_account_bank_statement.py @@ -11,6 +11,20 @@ from odoo.addons.account.tests.test_account_bank_statement import ( @tagged("post_install", "-at_install") class TestAccountBankStatementLine(TestAccountBankStatementCommon): + @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, + ) + ) + def test_button_undo_reconciliation(self): statement = self.env["account.bank.statement"].create( { diff --git a/account_move_reconcile_forbid_cancel/tests/test_account_move_reconcile_forbid_cancel.py b/account_move_reconcile_forbid_cancel/tests/test_account_move_reconcile_forbid_cancel.py index f5f7c92e..f88f8f71 100644 --- a/account_move_reconcile_forbid_cancel/tests/test_account_move_reconcile_forbid_cancel.py +++ b/account_move_reconcile_forbid_cancel/tests/test_account_move_reconcile_forbid_cancel.py @@ -10,6 +10,16 @@ class TestAccountMoveReconcileForbidCancel(TransactionCase): @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["account.journal"].create( {"name": "Bank Journal", "code": "BANK", "type": "bank"} ) diff --git a/account_reconcile_payment_order/tests/test_account_reconcile_payment_order.py b/account_reconcile_payment_order/tests/test_account_reconcile_payment_order.py index 5a54294d..397f4200 100644 --- a/account_reconcile_payment_order/tests/test_account_reconcile_payment_order.py +++ b/account_reconcile_payment_order/tests/test_account_reconcile_payment_order.py @@ -14,6 +14,16 @@ class TestAccountReconcilePaymentOrder(TestPaymentOrderInboundBase): @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.widget_obj = cls.env["account.reconciliation.widget"] cls.bank_journal = cls.env["account.journal"].create( {"name": "Test bank journal", "type": "bank"} diff --git a/account_reconciliation_widget/tests/test_reconciliation_widget.py b/account_reconciliation_widget/tests/test_reconciliation_widget.py index b2cb8f45..87ba77dc 100644 --- a/account_reconciliation_widget/tests/test_reconciliation_widget.py +++ b/account_reconciliation_widget/tests/test_reconciliation_widget.py @@ -65,6 +65,16 @@ class TestReconciliationWidget(TestAccountReconciliationCommon): @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.acc_bank_stmt_model = cls.env["account.bank.statement"] cls.acc_bank_stmt_line_model = cls.env["account.bank.statement.line"] diff --git a/account_reconciliation_widget_due_date/tests/test_account_reconciliation_widget_date_due.py b/account_reconciliation_widget_due_date/tests/test_account_reconciliation_widget_date_due.py index 36601036..fef62935 100644 --- a/account_reconciliation_widget_due_date/tests/test_account_reconciliation_widget_date_due.py +++ b/account_reconciliation_widget_due_date/tests/test_account_reconciliation_widget_date_due.py @@ -7,50 +7,62 @@ from odoo.tests.common import Form, TransactionCase class TestAccountReconciliationWidgetDueDate(TransactionCase): - def setUp(self): - super().setUp() - self.company = self.env.ref("base.main_company") - self.journal = self.env["account.journal"].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.company = cls.env.ref("base.main_company") + cls.journal = cls.env["account.journal"].create( {"name": "Test journal bank", "type": "bank", "code": "BANK-TEST"} ) - self.account = self.env["account.account"].create( + cls.account = cls.env["account.account"].create( { "name": "Account Receivable", "code": "AR", - "user_type_id": self.env.ref("account.data_account_type_receivable").id, + "user_type_id": cls.env.ref("account.data_account_type_receivable").id, "reconcile": True, } ) - self.partner_a = self.env["res.partner"].create( + cls.partner_a = cls.env["res.partner"].create( { "name": "Partner Test A", - "property_account_receivable_id": self.account.id, + "property_account_receivable_id": cls.account.id, } ) - self.partner_b = self.partner_a.copy({"name": "Partner Test B"}) - self.partner_c = self.partner_a.copy({"name": "Partner Test C"}) - self.statement = self._create_account_bank_statement() + cls.partner_b = cls.partner_a.copy({"name": "Partner Test B"}) + cls.partner_c = cls.partner_a.copy({"name": "Partner Test C"}) + cls.statement = cls._create_account_bank_statement() - def _create_account_bank_statement(self): - statement_form = Form(self.env["account.bank.statement"]) - statement_form.journal_id = self.journal + @classmethod + def _create_account_bank_statement(cls): + statement_form = Form(cls.env["account.bank.statement"]) + statement_form.journal_id = cls.journal statement_form.date = date(2021, 3, 1) statement_form.balance_end_real = 600.00 with statement_form.line_ids.new() as line_form: line_form.date = "2021-01-01" line_form.payment_ref = "LINE_A" - line_form.partner_id = self.partner_a + line_form.partner_id = cls.partner_a line_form.amount = 100.00 with statement_form.line_ids.new() as line_form: line_form.date = "2021-02-01" line_form.date_due = "2021-02-05" line_form.payment_ref = "LINE_B" - line_form.partner_id = self.partner_b + line_form.partner_id = cls.partner_b line_form.amount = 200.00 with statement_form.line_ids.new() as line_form: line_form.date = "2021-03-01" line_form.payment_ref = "LINE_C" - line_form.partner_id = self.partner_c + line_form.partner_id = cls.partner_c line_form.amount = 300.00 return statement_form.save()