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

need to remove first empty element from selection drop down list.and one is selected default.please advice me to do that friends..

selection field

its comes like

Gender
-----------------------------
|                         |v|
-----------------------------
EMPTY ELEMENT
-----------------------------
Male
-----------------------------
Female
-----------------------------
아바타
취소
베스트 답변

Or we can make this field required to remove the blank value

with required="1"

아바타
취소
베스트 답변

We can remove empty option by adding an attribute to the field that is required='True'.

i.e

inventory_availability = fields.Selection([
('never', 'Sell regardless of inventory'),
('custom', 'Show product-specific notifications'),
], string='Inventory Availability', default='never', required=True)


아바타
취소
관련 게시물 답글 화면 활동
2
12월 23
12683
2
6월 21
18472
0
9월 20
3701
0
5월 16
4102
1
8월 15
9543