summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVictor Feyens <vfe@odoo.com>2019-09-17 13:52:59 +0000
committerRaphael Collet <rco@odoo.com>2019-11-18 12:25:05 +0000
commit48b887618ccdd2950b504c8e12b77c712f4cb4c5 (patch)
tree94a69e317130b175d00789c8de459717a754cc95
parent9215e73fa229d64167de076ef0a288dd8d89a2cc (diff)
[IMP] * : replace with_context(allowed_cids=[c]) by with_company(c).
-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")