From 39a0162b80fd9185f8d883de6c5a9343cec7c7e7 Mon Sep 17 00:00:00 2001 From: RomainLibert Date: Wed, 7 Aug 2019 14:44:25 +0000 Subject: [IMP] hr_holidays: Improve general UX (back2basics) TaskID: 2048892 closes odoo/odoo#35541 Signed-off-by: Yannick Tivisse (yti) --- .../tests/test_timesheet_holidays.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'addons/project_timesheet_holidays') 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') -- cgit v1.2.3