Skip to Content
Menu
Musisz się zarejestrować, aby móc wchodzić w interakcje z tą społecznością.
To pytanie dostało ostrzeżenie
3 Odpowiedzi
22965 Widoki

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
-----------------------------
Awatar
Odrzuć
Najlepsza odpowiedź

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

with required="1"

Awatar
Odrzuć
Najlepsza odpowiedź

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)


Awatar
Odrzuć
Powiązane posty Odpowiedzi Widoki Czynność
2
gru 23
12633
2
cze 21
18444
0
wrz 20
3674
0
maj 16
4062
1
sie 15
9520