[FIX] hr_work_entry_holidays: remove faulty test

Removed this test because
  1. What it was testing doesn't make sense, namely the behaviour of
     resource leave creation when you explicitly set the resource
     calendar id of the employee to a different one than the one on the
     current running contract, which is an inconsistent state that
     generates warning messages when you try to do so.
  2. The test wasn't testing that correctly because it was only testing
     whether two resource leaves were created, but not whether they were
     actually created in the two different calendars, which was not the
     case.

Part-of: odoo/odoo#119317
This commit is contained in:
Rob Coekaerts
2023-09-26 09:32:27 +00:00
parent 7359c6de08
commit 88b55a658e
@@ -30,20 +30,6 @@ class TestWorkEntryLeave(TestWorkEntryHolidaysBase):
self.assertEqual(len(resource_leave), 1, "it should have created only one resource leave")
self.assertEqual(resource_leave.work_entry_type_id, self.leave_type.work_entry_type_id, "it should have the corresponding work_entry type")
def test_resource_leave_different_calendars(self):
other_calendar = self.env['resource.calendar'].create({'name': 'New calendar'})
contract = self.richard_emp.contract_ids[0]
contract.resource_calendar_id = other_calendar
contract.state = 'open' # this set richard's calendar to New calendar
# set another calendar
self.richard_emp.resource_calendar_id = self.env['resource.calendar'].create({'name': 'Other calendar'})
leave = self.create_leave()
resource_leave = leave._create_resource_leave()
self.assertEqual(len(resource_leave), 2, "it should have created one resource leave per calendar")
self.assertEqual(resource_leave.mapped('work_entry_type_id'), self.leave_type.work_entry_type_id, "they should have the corresponding work_entry type")
def test_create_mark_conflicting_work_entries(self):
work_entry = self.create_work_entry(datetime(2019, 10, 10, 9, 0), datetime(2019, 10, 10, 12, 0))
self.assertNotEqual(work_entry.state, 'conflict', "It should not be conflicting")