[PATCH] Upstream patch - 25122021

This commit is contained in:
Parthiv Patel committed 2021-12-25 09:34:46 +00:00
1 parent 505a7c0f4f
commit 44ba6871a2
1601 files changed
+7206 -5192

No files matched your search

+1 -1
View File
@@ -1,5 +1,5 @@
# -*- coding: utf-8 -*-
# Part of Odoo, Flectra. See LICENSE file for full copyright and licensing details.
# Part of Odoo. See LICENSE file for full copyright and licensing details.
from . import controllers
from . import models
+1 -1
View File
@@ -1,5 +1,5 @@
# -*- coding: utf-8 -*-
# Part of Odoo, Flectra. See LICENSE file for full copyright and licensing details.
# Part of Odoo. See LICENSE file for full copyright and licensing details.
{
'name': 'HR Org Chart',
+1 -1
View File
@@ -1,5 +1,5 @@
# -*- coding: utf-8 -*-
# Part of Odoo, Flectra. See LICENSE file for full copyright and licensing details.
# Part of Odoo. See LICENSE file for full copyright and licensing details.
from . import hr_org_chart_mixin
from . import hr_employee
+4
View File
@@ -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, Flectra. See LICENSE file for full copyright and licensing details.
from flectra.tests import Form, tagged, TransactionCase
from flectra.exceptions import MissingError
@tagged('post_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')
+2 -2
View File
@@ -8,7 +8,7 @@
<div id="o_work_employee_main" position="after">
<div id="o_employee_right">
<h4 class="o_org_chart_title mb16 mt0">Organization Chart</h4>
<field name="child_ids" widget="hr_org_chart"/>
<field name="child_ids" widget="hr_org_chart" readonly="1"/>
</div>
</div>
</field>
@@ -22,7 +22,7 @@
<xpath expr="//div[@id='o_work_employee_main']" position="after">
<div id="o_employee_right">
<h4 class="o_org_chart_title mb16 mt0">Organization Chart</h4>
<field name="child_ids" widget="hr_org_chart"/>
<field name="child_ids" widget="hr_org_chart" readonly="1"/>
</div>
</xpath>
</field>