From 7f908c6a69aa4d8885f86d5a481044bc7720ca6b Mon Sep 17 00:00:00 2001 From: Vincent Larcin Date: Wed, 7 Sep 2022 12:10:19 +0000 Subject: [PATCH] [FIX] project: make personal stage non required in task form view Since https://github.com/odoo/odoo/pull/90588, the personal stage is a required field in the task form view in debug mode. However, we only generate personal stage for a given user when that user is first assigned to a task. If a user creates their first task and assign it to themselves, they won't be able to give it a personal stage. To prevent issues linked to the current users not having personal stages, this commit makes the field not required, but prevents the user from unsetting it closes odoo/odoo#99735 Signed-off-by: Laurent Stukkens (ltu) --- addons/project/models/project.py | 3 +++ addons/project/views/project_views.xml | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/addons/project/models/project.py b/addons/project/models/project.py index 391ae1bf7c4..bfbae2e554a 100644 --- a/addons/project/models/project.py +++ b/addons/project/models/project.py @@ -2043,6 +2043,9 @@ class Task(models.Model): # Track user_ids to send assignment notifications old_user_ids = {t: t.user_ids for t in self} + if "personal_stage_type_id" in vals and not vals['personal_stage_type_id']: + del vals['personal_stage_type_id'] + result = super(Task, tasks).write(vals) if 'user_ids' in vals: diff --git a/addons/project/views/project_views.xml b/addons/project/views/project_views.xml index eeda3c9dc99..fc61e38ac91 100644 --- a/addons/project/views/project_views.xml +++ b/addons/project/views/project_views.xml @@ -1300,7 +1300,7 @@ - +