Odoo Help


how to display child task?

on 5/12/16, 2:30 AM 781 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'),


Gavin Yap
On 5/12/16, 3:45 AM

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" />
<page string="Child Task">
<field name="child_id" />
</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.

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.

on 5/12/16, 4:51 AM

Your Answer

Please try to give a substantial answer. If you wanted to comment on the question or answer, just use the commenting tool. Please remember that you can always revise your answers - no need to answer the same question twice. Also, please don't forget to vote - it really helps to select the best questions and answers!

About This Community

This platform is for beginners and experts willing to share their Odoo knowledge. It's not a forum to discuss ideas, but a knowledge base of questions and their answers.


Odoo Training Center

Access to our E-learning platform and experience all Odoo Apps through learning videos, exercises and Quizz.

Test it now

Question tools

1 follower(s)


Asked: 5/12/16, 2:30 AM
Seen: 781 times
Last updated: 5/12/16, 3:45 AM