[IMP] project: toggle state if task is subtask without project set

Before this commit, the state mode for subtask without any project set
is not the toggle one as it is the case for the private task.

This commit changes the state mode to have the toggle mode when the
task has no project set, that is, the subtask without any project set
or the private task since a subtask without a project set could be see
as a todo task and not a task in a real process as it is the case for a
task linked to a specific project.

task-3230063

closes odoo/odoo#115781

X-original-commit: e2d7ee73222ab3330da9c45570a4a6330d87c016
Related: odoo/enterprise#38378
Related: odoo/upgrade#4448
Signed-off-by: Xavier Bol (xbo) <xbo@odoo.com>
This commit is contained in:
Xavier Bol (xbo)
2023-03-24 02:23:37 +01:00
parent 58183d47e7
commit 3081278abc
@@ -109,7 +109,7 @@ export class ProjectTaskStateSelection extends StateSelectionField {
* Either the isToggleMode is active on the record OR the task is_private
*/
get isToggleMode() {
return this.props.isToggleMode || this.props.record.data.is_private;
return this.props.isToggleMode || !this.props.record.data.project_id;
}
async toggleState() {