diff options
| author | RomainLibert <rli@odoo.com> | 2019-08-07 14:44:25 +0000 |
|---|---|---|
| committer | Yannick Tivisse <yti@odoo.com> | 2019-08-13 13:35:17 +0000 |
| commit | 39a0162b80fd9185f8d883de6c5a9343cec7c7e7 (patch) | |
| tree | 7893f40abb201cfa7a59a240b46565750def3ce4 /addons/project_timesheet_holidays | |
| parent | fad9a6418158d952f97f8a070b501315fa394a93 (diff) | |
[IMP] hr_holidays: Improve general UX (back2basics)
TaskID: 2048892
closes odoo/odoo#35541
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
Diffstat (limited to 'addons/project_timesheet_holidays')
| -rw-r--r-- | addons/project_timesheet_holidays/tests/test_timesheet_holidays.py | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/addons/project_timesheet_holidays/tests/test_timesheet_holidays.py b/addons/project_timesheet_holidays/tests/test_timesheet_holidays.py index e7977266eb5..6aad4f1e51a 100644 --- a/addons/project_timesheet_holidays/tests/test_timesheet_holidays.py +++ b/addons/project_timesheet_holidays/tests/test_timesheet_holidays.py @@ -1,10 +1,10 @@ # -*- coding: utf-8 -*- # Part of Odoo. See LICENSE file for full copyright and licensing details. -from datetime import datetime, time +from datetime import datetime from dateutil.relativedelta import relativedelta -from odoo import fields +from odoo import fields, SUPERUSER_ID from odoo.tests import common, new_test_user from odoo.addons.hr_timesheet.tests.test_timesheet import TestCommonTimesheet @@ -97,11 +97,11 @@ class TestTimesheetHolidays(TestCommonTimesheet): 'date_to': self.leave_end_datetime, 'number_of_days': number_of_days, }) - holiday.sudo().action_validate() + holiday.with_user(SUPERUSER_ID).action_validate() self.assertEquals(len(holiday.timesheet_ids), number_of_days, 'Number of generated timesheets should be the same as the leave duration (1 per day between %s and %s)' % (fields.Datetime.to_string(self.leave_start_datetime), fields.Datetime.to_string(self.leave_end_datetime))) # manager refuse the leave - holiday.sudo().action_refuse() + holiday.with_user(SUPERUSER_ID).action_refuse() self.assertEquals(len(holiday.timesheet_ids), 0, 'Number of linked timesheets should be zero, since the leave is refused.') def test_validate_without_timesheet(self): @@ -115,5 +115,5 @@ class TestTimesheetHolidays(TestCommonTimesheet): 'date_to': self.leave_end_datetime, 'number_of_days': number_of_days, }) - holiday.sudo().action_validate() + holiday.with_user(SUPERUSER_ID).action_validate() self.assertEquals(len(holiday.timesheet_ids), 0, 'Number of generated timesheets should be zero since the leave type does not generate timesheet') |
