[FIX] project: fix multi level subtask

- Create a project
- Create 3 tasks in the project (top, middle, bottom)
- Set top as the parent of middle
- Set middle as the parent of bottom

We don't want to allow multi level subtasks. The behavior is not the
same if you set middle as the parent of bottom first. The "parent task"
field will not be displayed.

This commit remove the tasks who have a parent from the m2o field.

OPW-2087921

closes odoo/odoo#39810

X-original-commit: c7966b64c42940b606eaf3d985c49549928056bd
Signed-off-by: Jason Van Malder <jasonvanmalder@users.noreply.github.com>
This commit is contained in:
jvm-odoo
2019-11-05 13:55:26 +00:00
committed by fw-bot
parent c78cda8876
commit c27ba2af1c
+6 -1
View File
@@ -491,7 +491,12 @@
<field name="partner_id"/>
<field name="email_from" invisible="1"/>
<field name="email_cc" groups="base.group_no_one"/>
<field name="parent_id" attrs="{'invisible' : [('subtask_count', '>', 0)]}" groups="project.group_subtask_project"/>
<field
name="parent_id"
domain="[('parent_id', '=', False)]"
attrs="{'invisible' : [('subtask_count', '>', 0)]}"
groups="project.group_subtask_project"
/>
<field name="child_ids" invisible="1" />
<field name="subtask_project_id" invisible="1" />
<field name="company_id" groups="base.group_multi_company" options="{'no_create': True}"/>