14.0 project default assignees #15
@@ -12,9 +12,12 @@ class Task(models.Model):
|
|||||||
'''
|
'''
|
||||||
assigned project manager to the task if nobody else is assigned to
|
assigned project manager to the task if nobody else is assigned to
|
||||||
'''
|
'''
|
||||||
assignee_ids = vals.get('assignee_ids', [])
|
assignee_ids = vals.get('assignee_ids')
|
||||||
project_id = vals.get('project_id', [])
|
project_id = vals.get('project_id')
|
||||||
if project_id and assignee_ids and not assignee_ids[0][2]:
|
if project_id and self.env['project.project'].browse(project_id):
|
||||||
project = self.env['project.project'].browse(project_id)
|
project = self.env['project.project'].browse(project_id)
|
||||||
assignee_ids[0][2] = str(project.user_id.id)
|
if project.user_id:
|
||||||
|
default_assignee_id = project.user_id.id
|
||||||
|
if not assignee_ids or (assignee_ids and not assignee_ids[0][2]): #if assignee_ids doesnt existe or assignee_ids existe but is empty
|
||||||
|
vals['assignee_ids'] = [[6,0,[default_assignee_id]]]
|
||||||
return super().create(vals)
|
return super().create(vals)
|
@@ -24,7 +24,6 @@ Installation
|
|||||||
============
|
============
|
||||||
|
|
||||||
Use Odoo normal module installation procedure to install ``project_parent_tasks``.
|
Use Odoo normal module installation procedure to install ``project_parent_tasks``.
|
||||||
=======
|
|
||||||
|
|
||||||
Known issues / Roadmap
|
Known issues / Roadmap
|
||||||
======================
|
======================
|
||||||
|
Reference in New Issue
Block a user