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

Hi,

I would like know the way to get the list of mandatory fields from any object.

Will any orm method be some help?

your support is appreciated much.

thanks

아바타
취소
작성자 베스트 답변

Hi,

My colleague found the logic for this.

fields = self.pool.get('sale.order').fields_get(cr, uid)

required_fields = [field for field in fields if 'required' in fields[field] and fields[field]['required']]

print required_fields

Thanks

아바타
취소
관련 게시물 답글 화면 활동
4
12월 19
6234
0
3월 17
4578
1
1월 17
9660
3
10월 24
14250
2
3월 15
4977