Skip to Content
Menu
This question has been flagged
1 Atsakyti
4069 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
8605
0
rugp. 22
59
1
vas. 16
5876
0
gruod. 24
1024
1
kov. 24
1598