Skip to Content
เมนู
คุณต้องลงทะเบียนเพื่อโต้ตอบกับคอมมูนิตี้
คำถามนี้ถูกตั้งค่าสถานะ
1 ตอบกลับ
4077 มุมมอง

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)
อวตาร
ละทิ้ง
Related Posts ตอบกลับ มุมมอง กิจกรรม
2
ก.พ. 25
8675
0
ส.ค. 22
59
How to compare dates before validation แก้ไขแล้ว
1
ก.พ. 16
5886
0
ธ.ค. 24
1043
1
มี.ค. 24
1613