Skip to Content
Menu
This question has been flagged
1 Atsakyti
4314 Rodiniai

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

Portretas
Atmesti
Best Answer

Hi Josemi

you could do it like:

lowest_id = self.env['model_name'].search([('sequence', '!=', False)], order='ASC', limit=1)
Portretas
Atmesti
Related Posts Replies Rodiniai Veikla
2
vas. 25
9109
0
rugp. 22
59
1
vas. 16
6276
0
gruod. 24
1300
1
kov. 24
1923