[FIX] account_move_force_removal: Make tests resilient

On an integration enviroment, the test may fail searching for an account
that belongs to other company. Now we specifically look the an account
in current company.
This commit is contained in:
Pedro M. Baeza
2021-08-04 08:31:11 +02:00
committed by angel
parent 0b5538877c
commit e5f1c60474

View File

@@ -24,9 +24,14 @@ class TestMove(SavepointCase):
cls.product = cls.env["product.product"].create(
{"name": "Test product", "type": "service"}
)
cls.company = cls.env.company
account_type = cls.env.ref("account.data_account_type_other_income")
cls.income_account = cls.env["account.account"].search(
[("user_type_id", "=", account_type.id)], limit=1
[
("user_type_id", "=", account_type.id),
("company_id", "=", cls.company.id),
],
limit=1,
)
invoice = Form(