If I want to retrive a field on a recordset I can use
self.env['model.name'].search([('field1', '=', 'value' )]).field2
But how about if I need to grab in a list more than one field value?
Something like:
self.env['model.name'].search([('field1', '=', 'value' )]).(field2, field3, field4)
I need to return it as a simple list to manipulate it after.
Now I' m using a ' for in' cycle (I prefer over sql, even if more simple is less secure) but I don' t like it... How about 'search_read' with domain?
Solved with:
wt = self.env['model.name']
id_needed = wt.search([('field1', '=', 'value')]).id
new = wt.browse(id_needed)
list = [new.field1, new.field2, new.field3]
Is the most efficient way I found till now. But probably I can't optimize it a little more.