Odoo Help

0

how to display child task?

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

}


0
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" />
...
<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.

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.

vijay
on 5/12/16, 4:51 AM

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.

Register

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

2 follower(s)

Stats

Asked: 5/12/16, 2:30 AM
Seen: 1338 times
Last updated: 5/12/17, 11:13 AM