mirror of
https://github.com/bringout/oca-ocb-hr.git
synced 2026-04-25 07:52:00 +02:00
Initial commit: Hr packages
This commit is contained in:
commit
62531cd146
2820 changed files with 1432848 additions and 0 deletions
|
|
@ -0,0 +1,4 @@
|
|||
# -*- coding: utf-8 -*-
|
||||
# Part of Odoo. See LICENSE file for full copyright and licensing details.
|
||||
|
||||
from . import test_employee_deletion
|
||||
|
|
@ -0,0 +1,39 @@
|
|||
# -*- coding: utf-8 -*-
|
||||
# Part of Odoo. See LICENSE file for full copyright and licensing details.
|
||||
|
||||
from odoo.tests import Form, tagged, TransactionCase
|
||||
from odoo.exceptions import MissingError
|
||||
|
||||
@tagged('post_install', '-at_install')
|
||||
class TestEmployeeDeletion(TransactionCase):
|
||||
|
||||
def test_employee_deletion(self):
|
||||
# Tests an issue with the form view where the employee could be deleted
|
||||
employee_a, employee_b = self.env['hr.employee'].create([
|
||||
{
|
||||
'name': 'A',
|
||||
},
|
||||
{
|
||||
'name': 'B',
|
||||
},
|
||||
])
|
||||
department_a, department_b = self.env['hr.department'].create([
|
||||
{
|
||||
'name': 'DEP A',
|
||||
'manager_id': employee_a.id,
|
||||
},
|
||||
{
|
||||
'name': 'DEP B',
|
||||
'manager_id': employee_b.id,
|
||||
},
|
||||
])
|
||||
employee_a.write({
|
||||
'parent_id': employee_a.id,
|
||||
'coach_id': employee_a.id,
|
||||
'department_id': department_a.id,
|
||||
})
|
||||
try:
|
||||
with Form(employee_a) as form:
|
||||
form.department_id = department_b
|
||||
except MissingError:
|
||||
self.fail('The employee should not have been deleted')
|
||||
Loading…
Add table
Add a link
Reference in a new issue