[IMP] * : replace with_context(allowed_cids=[c]) by with_company(c).

This commit is contained in:
Victor Feyens
2019-11-18 12:25:05 +00:00
committed by Raphael Collet
parent 9215e73fa2
commit 48b887618c
2 changed files with 3 additions and 3 deletions
+2 -2
View File
@@ -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)
@@ -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")