Skip to content
Permalink
Browse files

[IMP] sale_timesheet: Avoid generated tasks on Undefined stage

Purpose
=======

Steps to reproduce:

- Configure a product of type service to create a task on a
  sales order validation, without configuring a project template
- On the SO confirmation, the project is generated without any stages

Additional issue:
- go to the Kanban view of the Project
- filter on something that doesn't give any result
- The kanban switches to edit mode, even if there is
  a task

This commit solves both issues.
  • Loading branch information...
tivisse committed Nov 8, 2019
1 parent d530fc2 commit 8468573aa9f8ade7e87cd11189d9f53e53ff7114
Showing with 5 additions and 0 deletions.
  1. +5 −0 addons/sale_timesheet/models/sale_order.py
@@ -265,6 +265,11 @@ def _timesheet_create_project(self):
})
else:
project = self.env['project.project'].create(values)

# Avoid new tasks to go to 'Undefined Stage'
if not project.type_ids:
project.type_ids = self.env['project.task.type'].create({'name': _('New')})

# link project as generated by current so line
self.write({'project_id': project.id})
return project

0 comments on commit 8468573

Please sign in to comment.
You can’t perform that action at this time.