-
-
Notifications
You must be signed in to change notification settings - Fork 794
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[MIG] project_parent_task_filter: Migration to 15.0
- Loading branch information
1 parent
79252d3
commit 2457ef0
Showing
4 changed files
with
29 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
from . import models |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
from . import project |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
|
||
from odoo import models,api | ||
|
||
class TaskSub(models.Model): | ||
_inherit = "project.task" | ||
|
||
@api.model_create_multi | ||
def create(self,vals_list): | ||
res=super(TaskSub, self).create(vals_list) | ||
for vals in vals_list: | ||
if vals.get('parent_id',False): | ||
res['display_project_id']=self.env["project.task"].browse( | ||
vals.get('parent_id') | ||
).project_id.id | ||
return res | ||
|
||
def action_subtask(self): | ||
action = {"type": "ir.actions.act_window", | ||
"name": "Subtasks of " + self.name, | ||
"res_model": "project.task", | ||
"view_mode": "tree,kanban", | ||
"search_view_id": [self.env.ref('project.view_task_search_form').id, 'search'], | ||
'domain': [('id', '!=', self.id), ('id', 'child_of', self.id)]} | ||
return action | ||
|
||
|