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

Hello Guys. Can some help with how to do checkboxes but the options are added through a selection field or can be added manually... and only one should be selected at a time.

I need both the python code and xml for view.

Thanks...


아바타
취소
작성자

Thanks, Waleed Mohsen, Am going to use radio buttons however much, How can I organize the radio buttons like putting three per row...

베스트 답변

You will use radio widget:

Add field in py:

type = fields.Selection(string='Type', selection=[('A', 'A'), ('B', 'B')])

in XML View,

<field name="type" widget="radio" >

If you want the radio boxes to show horizontally you will add options="{'horizontal': true}" 

<field name="type" widget="radio"  options="{'horizontal': true}"/>

 

아바타
취소
관련 게시물 답글 화면 활동
1
12월 19
3154
2
12월 23
14675
0
11월 23
1694
0
10월 23
33
3
10월 23
788