Passa al contenuto
Menu
È necessario essere registrati per interagire con la community.
La domanda è stata contrassegnata
1 Rispondi
3629 Visualizzazioni

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
Abbandona
Risposta migliore
task_ids","!=",False
Avatar
Abbandona

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

Autore

Thanks it works!

Post correlati Risposte Visualizzazioni Attività
2
dic 22
16024
1
set 22
2071
1
apr 20
142
1
giu 19
4082
1
nov 18
2636