Skip to Content
Menu
Musisz się zarejestrować, aby móc wchodzić w interakcje z tą społecznością.
To pytanie dostało ostrzeżenie
1 Odpowiedz
4033 Widoki

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

Awatar
Odrzuć
Najlepsza odpowiedź

Hi Josemi

you could do it like:

lowest_id = self.env['model_name'].search([('sequence', '!=', False)], order='ASC', limit=1)
Awatar
Odrzuć
Powiązane posty Odpowiedzi Widoki Czynność
2
lut 25
8549
0
sie 22
59
1
lut 16
5847
0
gru 24
992
1
mar 24
1549