I need to find for example all projects that have tasks.
task_ids = fields.One2Many('project.task', 'project_id')
Like: search([('task_ids', '>', 0)])?
Is there a way to do that or do I have to get tasks and then loop trough them to get project ids?
Odoo is the world's easiest all-in-one management software.
It includes hundreds of business apps:
I need to find for example all projects that have tasks.
task_ids = fields.One2Many('project.task', 'project_id')
Like: search([('task_ids', '>', 0)])?
Is there a way to do that or do I have to get tasks and then loop trough them to get project ids?
task_ids","!=",False
you can do this but many ways to do it
either you can these ways that i know:
for rec in self:
if rec.task_ids:
#statement
or self.search([('task_ids', '!=', False)])
Thanks it works!
관련 게시물 | 답글 | 화면 | 활동 | |
---|---|---|---|---|
|
2
12월 22
|
16207 | ||
|
1
9월 22
|
2155 | ||
|
1
4월 20
|
142 | ||
|
1
6월 19
|
4181 | ||
|
1
11월 18
|
2741 |