跳至内容
菜单
此问题已终结
5872 查看

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) 

形象
丢弃
相关帖文 回复 查看 活动
2
12月 22
16317
1
4月 20
142
1
6月 19
4254
2
6月 18
89
3
5月 24
3726