Přejít na obsah
Menu
You need to be registered to interact with the community.
This question has been flagged
1 Odpovědět
4028 Zobrazení

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šit
Nejlepší odpověď

Hi Josemi

you could do it like:

lowest_id = self.env['model_name'].search([('sequence', '!=', False)], order='ASC', limit=1)
Avatar
Zrušit
Related Posts Odpovědi Zobrazení Aktivita
2
úno 25
8548
0
srp 22
59
1
úno 16
5846
0
pro 24
990
1
bře 24
1546