Skip to Content
Meniu
Trebuie să fiți înregistrat pentru a interacționa cu comunitatea.
Această întrebare a fost marcată
3 Răspunsuri
23884 Vizualizări

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
-----------------------------
Imagine profil
Abandonează
Cel mai bun răspuns

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

with required="1"

Imagine profil
Abandonează
Cel mai bun răspuns

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)


Imagine profil
Abandonează
Related Posts Răspunsuri Vizualizări Activitate
2
dec. 23
13445
2
iun. 21
19107
0
sept. 20
4155
0
mai 16
4588
1
aug. 15
10007