[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:
@@ -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')
|
||||
|
||||
@@ -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',
|
||||
|
||||
Reference in New Issue
Block a user