Se rendre au contenu
Menu
Cette question a été signalée
1 Répondre
3856 Vues

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
Ignorer
Meilleure réponse
task_ids","!=",False
Avatar
Ignorer

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

Auteur

Thanks it works!

Publications associées Réponses Vues Activité
2
déc. 22
16317
1
sept. 22
2201
1
avr. 20
142
1
juin 19
4254
1
nov. 18
2860