| 1 |
# Part of Odoo. See LICENSE file for full copyright and licensing details. |
| 2 |
from odoo.addons.hr.tests.common import TestHrCommon |
| 3 |
|
| 4 |
|
| 5 |
class TestEmployeeDeleteWizard(TestHrCommon): |
| 6 |
def setUp(self): |
| 7 |
super().setUp() |
| 8 |
|
| 9 |
def test_delete_wizard_single_employee_with_timesheet(self): |
| 10 |
""" Test the deletion wizard in the case of a single employee """ |
| 11 |
employee_A = self.env['hr.employee'].create([ |
| 12 |
{ |
| 13 |
'name': 'Employee A', |
| 14 |
'user_id': False, |
| 15 |
'work_email': '[email protected]', |
| 16 |
} |
| 17 |
]) |
| 18 |
|
| 19 |
delete_wizard = self.env['hr.employee.delete.wizard'].create({ |
| 20 |
'employee_ids': [employee_A.id], |
| 21 |
}) |
| 22 |
|
| 23 |
returned_action_Record = delete_wizard.action_archive() |
| 24 |
|
| 25 |
self.assertEqual(returned_action_Record['context']['active_ids'], [employee_A.id], "Employee should have been selected") |
| 26 |
self.assertEqual(returned_action_Record['context']['employee_termination'], True, "Employee Termination should have been set") |