Skip ke Konten
Menu
Pertanyaan ini telah diberikan tanda
3 Replies
22130 Tampilan

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
-----------------------------
Avatar
Buang
Jawaban Terbai

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

with required="1"

Avatar
Buang
Jawaban Terbai

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)


Avatar
Buang
Post Terkait Replies Tampilan Aktivitas
2
Des 23
11918
2
Jun 21
17889
0
Sep 20
3224
0
Mei 16
3595
1
Agu 15
9039