Skip to Content
Menu
This question has been flagged
1 Reply
3312 Views

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

Hi Josemi

you could do it like:

lowest_id = self.env['model_name'].search([('sequence', '!=', False)], order='ASC', limit=1)
Avatar
Discard
Related Posts Replies Views Activity
0
Aug 22
59
2
Sep 18
6860
1
Feb 16
5086
1
Mar 24
583
3
Oct 23
2549