Skip to Content
मेन्यू
This question has been flagged
3 Replies
23187 Views

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

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

with required="1"

Avatar
Discard
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
Discard
Related Posts Replies Views Activity
2
दिस॰ 23
12814
2
जून 21
18608
0
सित॰ 20
3745
0
मई 16
4172
1
अग॰ 15
9638