[WIP]hr_employee_stats_sheet:add domaine on recovery type
This commit is contained in:
@@ -14,6 +14,7 @@ class TestHrEmployeeStatsRecovery(TransactionCase):
|
||||
self.recovery_type = self.env['hr.leave.type'].create({
|
||||
'name': 'Recovery',
|
||||
'request_unit': 'hour',
|
||||
'allows_negative': True,
|
||||
})
|
||||
self.employee = self.env['hr.employee'].create({
|
||||
'name': 'Camille',
|
||||
@@ -63,6 +64,15 @@ class TestHrEmployeeStatsRecovery(TransactionCase):
|
||||
stat._compute_hours()
|
||||
yield stat
|
||||
|
||||
def test_invalide_recovery_type(self):
|
||||
start_date = date.today() - timedelta(days=date.today().weekday() + 7) # lundi de la semaine dernière
|
||||
self.recovery_type.request_unit = 'day'
|
||||
self.recovery_type.allows_negative = False
|
||||
timesheet_sheet = self._create_timesheet_sheet(start_date)
|
||||
self.env.company.recovery_type_id = self.recovery_type
|
||||
with self.assertRaises(UserError):
|
||||
timesheet_sheet.action_generate_recovery_allocation()
|
||||
|
||||
def test_no_recovery_hours(self):
|
||||
start_date = date.today() - timedelta(days=date.today().weekday() + 7) # lundi de la semaine dernière
|
||||
timesheet_sheet = self._create_timesheet_sheet(start_date)
|
||||
|
Reference in New Issue
Block a user