跳至內容
選單
此問題已被標幟
1 回覆
4031 瀏覽次數

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

頭像
捨棄
最佳答案

Hi Josemi

you could do it like:

lowest_id = self.env['model_name'].search([('sequence', '!=', False)], order='ASC', limit=1)
頭像
捨棄
相關帖文 回覆 瀏覽次數 活動
2
2月 25
8549
0
8月 22
59
1
2月 16
5847
0
12月 24
992
1
3月 24
1548