Skip to Content
Meniu
Trebuie să fiți înregistrat pentru a interacționa cu comunitatea.
Această întrebare a fost marcată
1 Răspunde
3867 Vizualizări

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?

Imagine profil
Abandonează
Cel mai bun răspuns
task_ids","!=",False
Imagine profil
Abandonează

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 Răspunsuri Vizualizări Activitate
2
dec. 22
16324
1
sept. 22
2217
1
apr. 20
142
1
iun. 19
4268
1
nov. 18
2870