콘텐츠로 건너뛰기
메뉴
커뮤니티에 참여하려면 회원 가입을 하시기 바랍니다.
신고된 질문입니다
1 회신
4163 화면

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
8751
0
8월 22
59
1
2월 16
5978
0
12월 24
1077
1
3월 24
1692