Skip to content

Commit

Permalink
Merge PR #601 into 15.0
Browse files Browse the repository at this point in the history
Signed-off-by pedrobaeza
  • Loading branch information
OCA-git-bot committed Oct 20, 2023
2 parents d4d9f1e + 333bcdd commit 36f33b8
Show file tree
Hide file tree
Showing 5 changed files with 73 additions and 17 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,20 @@

@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(
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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"}
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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"}
Expand Down
10 changes: 10 additions & 0 deletions account_reconciliation_widget/tests/test_reconciliation_widget.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,50 +7,62 @@


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()

Expand Down

0 comments on commit 36f33b8

Please sign in to comment.