Skip to Content
Menu
You need to be registered to interact with the community.
This question has been flagged
3 Odgovori
23003 Prikazi

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

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

with required="1"

Avatar
Opusti
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
Opusti
Related Posts Odgovori Prikazi Aktivnost
2
dec. 23
12669
2
jun. 21
18465
0
sep. 20
3687
0
maj 16
4085
1
avg. 15
9538