Skip to content
Snippets Groups Projects
Commit 93ac9213 authored by Audric Onockx (auon)'s avatar Audric Onockx (auon)
Browse files

[FIX] hr_timesheet: uninstall project's 'timesheet' config


Steps :
Go to project > settings.
Check 'timesheet' config and save.
Uncheck it back and save.

Issue :
See errors in the logs, due to on delete restrict.

Cause :
Record 'hr_timesheet.internal_project_default_stage' from data
is deleted when hr_timesheet is uninstalled.
Yet some project task records still use it, so we can't delete it.

Fix :
Delete the corresponding ir.model.data to keep the stage,
but unlink it from the 'hr_timesheet.internal_project_default_stage' ref.

task-2998416

closes odoo/odoo#101633

Related: odoo/enterprise#32022
Signed-off-by: default avatarLaurent Stukkens (ltu) <ltu@odoo.com>
parent 4a8a21c4
No related branches found
No related tags found
No related merge requests found
......@@ -48,3 +48,5 @@ def _uninstall_hook(cr, registry):
project_ids = env['res.company'].search([('internal_project_id', '!=', False)]).mapped('internal_project_id')
if project_ids:
project_ids.write({'active': False})
env['ir.model.data'].search([('name', 'ilike', 'internal_project_default_stage')]).unlink()
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment