Перейти к содержимому
Меню
Чтобы взаимодействовать с сообществом, необходимо зарегистрироваться.
Этот вопрос был отмечен
3 Ответы
22941 Представления

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
12619
2
июн. 21
18437
0
сент. 20
3666
0
мая 16
4055
1
авг. 15
9512