Skip to Content
Menu
You need to be registered to interact with the community.
This question has been flagged
1 Odgovori
4023 Prikazi

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
Opusti
Best Answer

Hi Josemi

you could do it like:

lowest_id = self.env['model_name'].search([('sequence', '!=', False)], order='ASC', limit=1)
Avatar
Opusti
Related Posts Odgovori Prikazi Aktivnost
2
feb. 25
8543
0
avg. 22
59
1
feb. 16
5845
0
dec. 24
989
1
mar. 24
1545