Passa al contenuto
Menu
È necessario essere registrati per interagire con la community.
La domanda è stata contrassegnata
3 Risposte
22626 Visualizzazioni

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
Abbandona
Risposta migliore

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

with required="1"

Avatar
Abbandona
Risposta migliore

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
Abbandona
Post correlati Risposte Visualizzazioni Attività
2
dic 23
12366
2
giu 21
18195
0
set 20
3516
0
mag 16
3885
1
ago 15
9312