Skip ke Konten
Menu
Pertanyaan ini telah diberikan tanda
1 Balas
3801 Tampilan

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
Buang
Jawaban Terbai
task_ids","!=",False
Avatar
Buang

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

Penulis

Thanks it works!

Post Terkait Replies Tampilan Aktivitas
2
Des 22
16244
1
Sep 22
2178
1
Apr 20
142
1
Jun 19
4212
1
Nov 18
2797