Skip to Content
Меню
Вам необхідно зареєструватися, щоб взаємодіяти зі спільнотою.
Це запитання позначене
3 Відповіді
22579 Переглядів

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
-----------------------------
Аватар
Відмінити
Найкраща відповідь

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

with required="1"

Аватар
Відмінити
Найкраща відповідь

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)


Аватар
Відмінити
Related Posts Відповіді Переглядів Дія
2
груд. 23
12311
2
черв. 21
18158
0
вер. 20
3487
0
трав. 16
3849
1
серп. 15
9284