Skip to Content
Menu
This question has been flagged
1 Atsakyti
3937 Rodiniai

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?

Portretas
Atmesti
Best Answer
task_ids","!=",False
Portretas
Atmesti

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

Autorius

Thanks it works!

Related Posts Replies Rodiniai Veikla
2
gruod. 22
16403
1
rugs. 22
2304
1
bal. 20
142
1
birž. 19
4313
1
lapkr. 18
2954