Se rendre au contenu
Menu
Cette question a été signalée
5883 Vues

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) 

Avatar
Ignorer
Publications associées Réponses Vues Activité
2
déc. 22
16334
1
avr. 20
142
1
juin 19
4271
2
juin 18
89
3
mai 24
3750