Skip to Content
เมนู
คุณต้องลงทะเบียนเพื่อโต้ตอบกับคอมมูนิตี้
คำถามนี้ถูกตั้งค่าสถานะ
544 มุมมอง

In the my model, this was declared

address_to = fields.Selection([( 'sc_address' , 'Contact Address' ),

                                   ( 'location_address' , 'Location Address' )],

                                  string = "Address" ,

                                  default = 'sc_address' )

And this was in the view

<group string = "Address" >

<group>​​

    < field name = "address_to" widget = "radio" options = "{'horizontal': true}" />

    < field name = "frequent_location_id" invisible = "address_to != 'location_address'" />

  </ group >

</ group >

However, when viewing the form, nothing was selected.


It is weird because another identifier was also declared in the model

freight_collect_prepaid = fields.Selection([( 'Collect' , 'Collect' ),

                                                ( 'Prepaid' , 'Prepaid' )],

                                               string = "Freight Billing" ,

                                               default = "Collect" )

And in the view, when viewing the form, it was selected.

< group string = "General Details" >

       < field name = "bl_number" invisible = "transport == 'air'" />

       < field name = "freight_collect_prepaid" required = "1" widget = "radio"

                                               options = "{'horizontal':True}" />

</ group >


Where else will I look to correct this, I need the default value to be selected. Should I make it required so it will have a default?

อวตาร
ละทิ้ง
Related Posts ตอบกลับ มุมมอง กิจกรรม
1
ก.พ. 24
1908
2
ม.ค. 23
2206
1
ส.ค. 22
4891
1
ก.พ. 22
2015
1
ม.ค. 19
3717