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

I didn't find anything and I really don't know what to google for this problem.

I need to get a record from o2m relation by the value of it's field. I know how to do this with search:

self.child_ids.search([('specific_field', '=', 'specific_value')])

My problem is that I have to this at least 3 times, which means I do 3 DB query executions. I want to do this with only 1 and then get it with python without a for loop. Is this possible?

Like:

records = self.chlid_ids.search([])

record_with_value = records(something to get the correct record) 

อวตาร
ละทิ้ง
Related Posts ตอบกลับ มุมมอง กิจกรรม
how to use and in search? แก้ไขแล้ว
2
ธ.ค. 22
16382
1
เม.ย. 20
142
1
มิ.ย. 19
4306
2
มิ.ย. 18
89
3
พ.ค. 24
3787