Skip to Content
Menu
This question has been flagged
1 Odpoveď
4132 Zobrazenia

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
Zrušiť
Best Answer

Hi Josemi

you could do it like:

lowest_id = self.env['model_name'].search([('sequence', '!=', False)], order='ASC', limit=1)
Avatar
Zrušiť
Related Posts Replies Zobrazenia Aktivita
2
feb 25
8723
0
aug 22
59
1
feb 16
5958
0
dec 24
1069
1
mar 24
1666