summaryrefslogtreecommitdiff
path: root/addons/hr_timesheet/tests/test_timesheet.py
diff options
context:
space:
mode:
Diffstat (limited to 'addons/hr_timesheet/tests/test_timesheet.py')
-rw-r--r--addons/hr_timesheet/tests/test_timesheet.py5
1 files changed, 2 insertions, 3 deletions
diff --git a/addons/hr_timesheet/tests/test_timesheet.py b/addons/hr_timesheet/tests/test_timesheet.py
index 64e7f13d2af..4113b052ea0 100644
--- a/addons/hr_timesheet/tests/test_timesheet.py
+++ b/addons/hr_timesheet/tests/test_timesheet.py
@@ -267,10 +267,9 @@ class TestTimesheet(TestCommonTimesheet):
})
timesheets = timesheet_1 + timesheet_2
- # increase unit_amount to trigger amount recomputation
with self.assertRaises(AccessError):
- # because the employee 1 is the sudo and he doesn't have the access right to update timesheet of employee 2
- timesheets.sudo().write({
+ # should raise since employee 1 doesn't have the access rights to update employee's 2 timesheet
+ timesheets.with_user(self.empl_employee.user_id).write({
'unit_amount': 2,
})