Přejít na obsah
Menu
You need to be registered to interact with the community.
This question has been flagged
1 Odpovědět
3809 Zobrazení

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
Zrušit
Nejlepší odpověď
task_ids","!=",False
Avatar
Zrušit

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 Odpovědi Zobrazení Aktivita
2
pro 22
16251
1
zář 22
2185
1
dub 20
142
1
čvn 19
4214
1
lis 18
2798