Skip to Content
Menu
This question has been flagged
1 Reply
6130 Views

I have an module which is create sub task of task.and display subtask list in parent task.

now i want to display only thous subtask which has same project.


class project_parent_task(osv.Model):

_name = 'project.task'

_inherit = 'project.task'

_columns = {

'child_id':fields.one2many('project.task', 'parent_id', 'Child Task', domain=[('project_id', '=', 'project_id')]),

'parent_id': fields.many2one('project.task','Parent Task'),

}


Avatar
Discard
Best Answer

Supposedly what you already have is that 

  1. You have a reference field of the parent task

  2. You have a tree/list view of a subtask.

So in your form view, you should have already had something like

<field="parent_id" />
...
<notebook>
<page string="Child Task">
<div>
<field name="child_id" />
</div>
</page> ...


It depends which view navigation method you used. If you use kanban, then you would :

  1. Select from a project kanban, which displays

  2. Project Tasks Kanban

Include a link and set context to the Project task where, context={ 'search_default_parent_id': active_id }, should gives you the subtasks of a task.

Avatar
Discard
Author

now i want to display only thous subtask which has same project. eg: i create task1 with project1 and task2 with projec1,now i create subtask1 with task1,project1 and subtask2 with task1,project2 now i want to display only thous subtask which has project1.

Related Posts Replies Views Activity
1
Jun 23
1702
1
Nov 22
1767
2
Jun 20
2218
2
Jul 18
5789
4
Jul 18
6695