summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--addons/hr/tests/test_multi_company.py4
-rw-r--r--addons/project_timesheet_holidays/tests/test_timesheet_holidays.py2
2 files changed, 3 insertions, 3 deletions
diff --git a/addons/hr/tests/test_multi_company.py b/addons/hr/tests/test_multi_company.py
index 9eb3d9b0df5..bb07225749e 100644
--- a/addons/hr/tests/test_multi_company.py
+++ b/addons/hr/tests/test_multi_company.py
@@ -31,6 +31,6 @@ class TestMultiCompany(TestHrCommon):
def test_single_company_report(self):
with self.assertRaises(QWebException): # CacheMiss followed by AccessError
- content, content_type = self.env.ref('hr.hr_employee_print_badge').with_user(self.res_users_hr_officer).with_context(
- allowed_company_ids=[self.company_1.id]
+ content, content_type = self.env.ref('hr.hr_employee_print_badge').with_user(self.res_users_hr_officer).with_company(
+ self.company_1
).render_qweb_pdf(res_ids=self.employees.ids)
diff --git a/addons/project_timesheet_holidays/tests/test_timesheet_holidays.py b/addons/project_timesheet_holidays/tests/test_timesheet_holidays.py
index 84c80cb133a..e999b84e8ae 100644
--- a/addons/project_timesheet_holidays/tests/test_timesheet_holidays.py
+++ b/addons/project_timesheet_holidays/tests/test_timesheet_holidays.py
@@ -31,7 +31,7 @@ class TestTimesheetHolidaysCreate(common.TransactionCase):
company_ids=[(6, 0, main_company.ids)])
Company = self.env['res.company']
Company = Company.with_user(user)
- Company = Company.with_context(allowed_company_ids=main_company.ids)
+ Company = Company.with_company(main_company)
company = Company.create({'name': "Wall Company"})
self.assertEqual(company.leave_timesheet_project_id.sudo().company_id, company, "It should have created a project for the company")