From 40934f4089c82f76ca88173271eb10dad7309e1a Mon Sep 17 00:00:00 2001 From: Aman Patel Date: Wed, 28 Jun 2023 05:12:42 +0000 Subject: [PATCH] [FIX] hr_timesheet: internal project visible only in configuration menu Steps: - Install timesheet. - Go to configuration->projects. - Internal project is visible. - Check the projects menu. - Internal project not visible. - Turn on project stages from the configuration. Issue: - After turning on project stages, the internal project gets visible in projects menu as well. Cause: - We have not set 'is_internal_project' to false for group stages. Fix: - Set 'is_internal_project' to false. task-3392129 closes odoo/odoo#143796 X-original-commit: ac2aa3fc810f2edf60ae2e276abfbb7432e5b633 Signed-off-by: Xavier Bol (xbo) --- addons/hr_timesheet/__init__.py | 11 ++++++++--- addons/hr_timesheet/views/project_project_views.xml | 4 ++++ 2 files changed, 12 insertions(+), 3 deletions(-) diff --git a/addons/hr_timesheet/__init__.py b/addons/hr_timesheet/__init__.py index 4d3683ab469..726aec9a949 100644 --- a/addons/hr_timesheet/__init__.py +++ b/addons/hr_timesheet/__init__.py @@ -33,9 +33,14 @@ def create_internal_project(env): _check_exists_collaborators_for_project_sharing(env) def _uninstall_hook(env): - act_window = env.ref('project.open_view_project_all', raise_if_not_found=False) - if act_window and act_window.domain and 'is_internal_project' in act_window.domain: - act_window.domain = [] + + def update_action_window(xmlid): + act_window = env.ref(xmlid, raise_if_not_found=False) + if act_window and act_window.domain and 'is_internal_project' in act_window.domain: + act_window.domain = [] + + update_action_window('project.open_view_project_all') + update_action_window('project.open_view_project_all_group_stage') # archive the internal projects project_ids = env['res.company'].search([('internal_project_id', '!=', False)]).mapped('internal_project_id') diff --git a/addons/hr_timesheet/views/project_project_views.xml b/addons/hr_timesheet/views/project_project_views.xml index f3efdc91765..87aaad90b3e 100644 --- a/addons/hr_timesheet/views/project_project_views.xml +++ b/addons/hr_timesheet/views/project_project_views.xml @@ -90,5 +90,9 @@ [('is_internal_project', '=', False)] + + + [('is_internal_project', '=', False)] +