[FIX] project: default context key

- Activate Sub-tasks in projects
- Create a sub-task

An `AccessError` is raised in `check_access_rule` of `mail.message`.

The context is 'polluted' with a `default_parent_id` key, which is not
necessary anymore at this point.

opw-1924899

closes odoo/odoo#31022
This commit is contained in:
Nicolas Martinelli
2019-02-12 11:21:21 +00:00
parent 7afdfc5046
commit 11dc4ec487
+1
View File
@@ -680,6 +680,7 @@ class Task(models.Model):
# force some parent values, if needed
if 'parent_id' in vals and vals['parent_id']:
vals.update(self._subtask_values_from_parent(vals['parent_id']))
context.pop('default_parent_id', None)
# for default stage
if vals.get('project_id') and not context.get('default_project_id'):
context['default_project_id'] = vals.get('project_id')