Skip to content

Commit

Permalink
[14.0][FIX] l10n_ch_base_bank
Browse files Browse the repository at this point in the history
This is a forward port of

* OCA#603

On an unrelated PR the test for l10n_ch_base_bank were broken.
It seems to be related to this new change introduced by

* odoo/odoo#67599

Which test the valid of the type journal.

So this fixes the test, but I am not sure if they are still meaningfull.
  • Loading branch information
TDu authored and ivantodorovich committed Jan 3, 2023
1 parent fc0c696 commit 33a691f
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 14 deletions.
23 changes: 14 additions & 9 deletions l10n_ch_base_bank/tests/test_create_invoice.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,20 +14,25 @@ def setUpClass(cls):
bank = cls.env["res.bank"].create(
{"name": "BCV", "bic": "BBRUBEBB", "clearing": "234234"}
)
# define company bank account
cls.bank_journal = cls.env["account.journal"].create(
cls.env["res.partner.bank"].create(
{
"partner_id": cls.company.partner_id.id,
"bank_id": bank.id,
"acc_number": "ISR",
"l10n_ch_isr_subscription_chf": "01-162-8",
"sequence": 1,
}
)
cls.journal = cls.env["account.journal"].create(
{
"name": "Test Sale Journal",
"company_id": cls.company.id,
"type": "bank",
"code": "BNK42",
"type": "sale",
"code": "SALE123",
"bank_id": bank.id,
"bank_acc_number": "01-1234-1",
}
)
cls.bank_acc = cls.bank_journal.bank_account_id
cls.bank_acc.write({"l10n_ch_isr_subscription_chf": "01-162-8", "sequence": 1})
fields_list = ["company_id", "user_id", "currency_id", "journal_id"]
cls.inv_values = cls.env["account.move"].default_get(fields_list)

def new_form(self):
inv = Form(
Expand All @@ -38,7 +43,7 @@ def new_form(self):
# view='account.view_move_form'
# )
inv.partner_id = self.partner
inv.journal_id = self.bank_journal
inv.journal_id = self.journal
return inv

def test_emit_move_with_isr_ref(self):
Expand Down
11 changes: 6 additions & 5 deletions l10n_ch_base_bank/tests/test_search_invoice.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ def setUpClass(cls):
super().setUpClass()
cls.env = cls.env(context=dict(cls.env.context, tracking_disable=True))
cls.company = cls.env.ref("base.main_company")
cls.partner = cls.env.ref("base.res_partner_12")
bank = cls.env["res.bank"].create(
{"name": "BCV", "bic": "BBRUBEBB", "clearing": "234234"}
)
Expand All @@ -24,12 +25,12 @@ def setUpClass(cls):
"sequence": 1,
}
)
cls.partner = cls.env["res.partner"].create({"name": "Test"})
cls.bank_journal = cls.env["account.journal"].create(
cls.journal = cls.env["account.journal"].create(
{
"name": "Test Journal",
"company_id": cls.company.id,
"type": "bank",
"code": "BNK42",
"type": "sale",
"code": "SALE123",
"bank_id": bank.id,
"bank_acc_number": "10-8060-7",
}
Expand All @@ -42,7 +43,7 @@ def new_form(self):
# view='account.view_move_form'
# )
inv.partner_id = self.partner
inv.journal_id = self.bank_journal
inv.journal_id = self.journal
return inv

def assert_find_ref(self, ref, operator, value):
Expand Down

0 comments on commit 33a691f

Please sign in to comment.