コンテンツへスキップ
メニュー
この質問にフラグが付けられました
3 返信
23002 ビュー

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)


アバター
破棄
関連投稿 返信 ビュー 活動
2
12月 23
12668
2
6月 21
18465
0
9月 20
3687
0
5月 16
4085
1
8月 15
9538