From 4ac648cf3d3085910310abaf127e65453f05e3f9 Mon Sep 17 00:00:00 2001 From: Simone Rubino Date: Wed, 5 Jun 2024 14:20:29 +0200 Subject: [PATCH] [FIX] l10n_it_bill_of_entry: Multi company management in tests The user must be logged in only one company for the tests to behave as expected. For instance, searching for a journal should only find journals in the current company --- l10n_it_bill_of_entry/tests/test_bill_of_entry.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/l10n_it_bill_of_entry/tests/test_bill_of_entry.py b/l10n_it_bill_of_entry/tests/test_bill_of_entry.py index 19513c4a1e63..0004fb2bb21d 100644 --- a/l10n_it_bill_of_entry/tests/test_bill_of_entry.py +++ b/l10n_it_bill_of_entry/tests/test_bill_of_entry.py @@ -47,6 +47,10 @@ def setUp(self): demo_data_company = self.env.ref("base.main_company") self.env.user.company_ids |= demo_data_company self.env.user.company_id = demo_data_company + # Now that current user can access the company, + # log the user *only* in this company so that + # searching, reading and other operations behave as expected + self.env.user.company_ids = demo_data_company # Default accounts for invoice line account_id self.account_revenue = self.account_model.search(