İçereği Atla
Menü
Bu soru işaretlendi
1 Cevapla
3816 Görünümler

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
Vazgeç
En İyi Yanıt
task_ids","!=",False
Avatar
Vazgeç

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

Üretici

Thanks it works!

İlgili Gönderiler Cevaplar Görünümler Aktivite
2
Ara 22
16266
1
Eyl 22
2188
1
Nis 20
142
1
Haz 19
4227
1
Kas 18
2814