Skip to Content
เมนู
คุณต้องลงทะเบียนเพื่อโต้ตอบกับคอมมูนิตี้
คำถามนี้ถูกตั้งค่าสถานะ
1 ตอบกลับ
3938 มุมมอง

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?

อวตาร
ละทิ้ง
คำตอบที่ดีที่สุด
task_ids","!=",False
อวตาร
ละทิ้ง

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

ผู้เขียน

Thanks it works!

Related Posts ตอบกลับ มุมมอง กิจกรรม
how to use and in search? แก้ไขแล้ว
2
ธ.ค. 22
16403
1
ก.ย. 22
2304
1
เม.ย. 20
142
1
มิ.ย. 19
4313
1
พ.ย. 18
2954