Skip to Content
Menú
This question has been flagged
3 Respostes
22895 Vistes

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
Descartar
Best Answer

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

with required="1"

Avatar
Descartar
Best Answer

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
Descartar
Related Posts Respostes Vistes Activitat
2
de des. 23
12594
2
de juny 21
18412
0
de set. 20
3655
0
de maig 16
4027
1
d’ag. 15
9491