İçereği Atla
Menü
Bu soru işaretlendi
3 Cevaplar
22956 Görünümler

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
Vazgeç
En İyi Yanıt

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

with required="1"

Avatar
Vazgeç
En İyi Yanıt

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
Vazgeç
İlgili Gönderiler Cevaplar Görünümler Aktivite
2
Ara 23
12629
2
Haz 21
18440
0
Eyl 20
3673
0
May 16
4061
1
Ağu 15
9520