Skip to Content
Menu
You need to be registered to interact with the community.
This question has been flagged
1 Odgovori
3635 Prikazi

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?

Avatar
Opusti
Best Answer
task_ids","!=",False
Avatar
Opusti

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)])

Avtor

Thanks it works!

Related Posts Odgovori Prikazi Aktivnost
2
dec. 22
16032
1
sep. 22
2075
1
apr. 20
142
1
jun. 19
4087
1
nov. 18
2641