Přejít na obsah
Menu
You need to be registered to interact with the community.
This question has been flagged
3 Odpovědi
22989 Zobrazení

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
Zrušit
Nejlepší odpověď

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

with required="1"

Avatar
Zrušit
Nejlepší odpověď

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
Zrušit
Related Posts Odpovědi Zobrazení Aktivita
2
pro 23
12648
2
čvn 21
18455
0
zář 20
3681
0
kvě 16
4070
1
srp 15
9528