Skip to Content
Menú
This question has been flagged
1 Respondre
3802 Vistes

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
Descartar
Best Answer
task_ids","!=",False
Avatar
Descartar

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

Autor

Thanks it works!

Related Posts Respostes Vistes Activitat
2
de des. 22
16245
1
de set. 22
2179
1
d’abr. 20
142
1
de juny 19
4213
1
de nov. 18
2797