From e5f1c60474620b00bb0a7c97d9e893e9bfb6b1a1 Mon Sep 17 00:00:00 2001 From: "Pedro M. Baeza" Date: Wed, 4 Aug 2021 08:31:11 +0200 Subject: [PATCH] [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. --- account_move_force_removal/tests/test_move.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/account_move_force_removal/tests/test_move.py b/account_move_force_removal/tests/test_move.py index 5d90d8a9b..660fb8a24 100644 --- a/account_move_force_removal/tests/test_move.py +++ b/account_move_force_removal/tests/test_move.py @@ -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(