Files
odoo_source/addons/account/tests/test_setup_wizard.py
T
Guillaume (guva) 701fd8538a [FIX] account: setup bank wizard validation
When adding a bank account via the setup wizard,
an User Error is raised ("Incompatible companies on records")
Since 0479b2b594,
`check_company` is set to `True` on
`SetupBarBankConfigWizard.linked_journal_id`, but
the model has no `company_id` field.
Therefore in `BaseModel._check_company()`, no
company is found and we raise the error.

Steps:

- Go to accounting dashboard
- Make sure the "onboarding" banner is not removed from the view
- Click on "Add a bank account" on the banner
- Try to create a new one (bottom right of the wizard)
- Enter an account number, select a bank and validate
-> Error is raised

opw-3473184

closes odoo/odoo#133214

X-original-commit: 8d9c0c27d389ecd21a5c32ebba1e8da14316b6c0
Signed-off-by: Brice Bartoletti (bib) <bib@odoo.com>
Signed-off-by: Guillaume Vanleynseele (guva) <guva@odoo.com>
2023-08-25 18:50:17 +02:00

23 lines
758 B
Python

# -*- coding: utf-8 -*-
from odoo.addons.account.tests.common import AccountTestInvoicingCommon
from odoo.tests import tagged
@tagged('post_install', '-at_install')
class TestSetupWizard(AccountTestInvoicingCommon):
def test_setup_bank_account(self):
"""
Test that no error is raised when creating the bank setup wizard
"""
wizard = self.env['account.setup.bank.manual.config'].create([
{
'num_journals_without_account': 1,
'linked_journal_id': False,
'acc_number': 'BE15001559627230',
'bank_id': self.env['res.bank'].create({'name': 'Test bank'}).id,
'bank_bic': False
}
])
self.assertTrue(wizard)