[FIX] project: incorrect creation of recurring tasks

In case X several recurrences are processed in the same cron execution,
only the last recurring task was created X times, while the other tasks
were not created. There is also a missing id preventing a correct use of
the default stage for the new created task.

closes odoo/odoo#70784

X-original-commit: 5ea2fcbecf572be24af9b2aac76de9e5d5709d2c
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
Signed-off-by: Alex Tuyls <alt-odoo@users.noreply.github.com>
This commit is contained in:
alt-odoo
2021-05-12 17:10:46 +00:00
parent c93dffc39a
commit ca71ebad9b
@@ -221,7 +221,7 @@ class ProjectTaskRecurrence(models.Model):
children = []
# copy the subtasks of the original task
for child in task.child_ids:
child_values = self._new_task_values(child)
child_values = recurrence._new_task_values(child)
child_values['parent_id'] = new_task.id
children.append(child_values)
self.env['project.task'].create(children)