[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) <xbo@odoo.com>
This commit is contained in:
Aman Patel
2023-11-30 06:24:15 +00:00
committed by Xavier Bol (xbo)
parent 0feaa4f650
commit 40934f4089
2 changed files with 12 additions and 3 deletions
+8 -3
View File
@@ -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')
@@ -90,5 +90,9 @@
<record id="project.open_view_project_all" model="ir.actions.act_window">
<field name="domain">[('is_internal_project', '=', False)]</field>
</record>
<record id="project.open_view_project_all_group_stage" model="ir.actions.act_window">
<field name="domain">[('is_internal_project', '=', False)]</field>
</record>
</data>
</odoo>