Ir al contenido
Menú
Se marcó esta pregunta
3 Respuestas
22057 Vistas

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
Mejor respuesta

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

with required="1"

Avatar
Descartar
Mejor respuesta

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
Publicaciones relacionadas Respuestas Vistas Actividad
2
dic 23
11875
2
jun 21
17807
0
sept 20
3159
0
may 16
3539
1
ago 15
8978