14.0 project default assignees #15

Merged
LaetitiaElabore merged 3 commits from 14.0-project_default_assignees into 14.0-allow_assigned_portal_users 2023-11-21 15:44:24 +00:00
2 changed files with 7 additions and 5 deletions

View File

@@ -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)

View File

@@ -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
====================== ======================