Ir al contenido
Menú
Se marcó esta pregunta
1 Responder
4053 Vistas

I have this class

name = fields.Char("Name")

sequence = fields.Integer("Sequence")

description = fields.Text("Description")

I need a search method to find the id with lower sequence

Avatar
Descartar
Mejor respuesta

Hi Josemi

you could do it like:

lowest_id = self.env['model_name'].search([('sequence', '!=', False)], order='ASC', limit=1)
Avatar
Descartar
Publicaciones relacionadas Respuestas Vistas Actividad
2
feb 25
8568
0
ago 22
59
1
feb 16
5861
0
dic 24
1005
1
mar 24
1577