[FIX] hr_org_chart : fix hiercharchy view unistallation

STEP TO REPRODUCE:
=================

    * Unistall hr_org_chart application
    * Click on hr application

You will have an error due to the missing hiercharchy view.

closes odoo/odoo#158523

Signed-off-by: Bertrand Dossogne (bedo) <bedo@odoo.com>
This commit is contained in:
Mélanie
2024-04-12 08:16:07 +00:00
parent 784f90d256
commit 18157e2da2
2 changed files with 12 additions and 0 deletions
+11
View File
@@ -3,3 +3,14 @@
from . import controllers
from . import models
def _uninstall_hook(env):
def update_view_mode(view):
act_window = env.ref(view, raise_if_not_found=False)
if act_window and 'hierarchy' in act_window.view_mode:
act_window.view_mode = ','.join(view_mode for view_mode in act_window.view_mode.split(',') if view_mode != 'hierarchy')
update_view_mode('hr.hr_employee_public_action')
update_view_mode('hr.hr_department_kanban_action')
update_view_mode('hr.hr_department_tree_action')
update_view_mode('hr.open_view_employee_list_my')
+1
View File
@@ -21,6 +21,7 @@ This module extend the employee form with a organizational chart.
'views/hr_employee_public_views.xml',
'views/hr_org_chart_menus.xml',
],
'uninstall_hook': '_uninstall_hook',
'assets': {
'web._assets_primary_variables': [
'hr_org_chart/static/src/scss/variables.scss',