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

Hi, In a webkit report, how can I get the value instead of the key for a selection field ? AMa

อวตาร
ละทิ้ง

pls can you help me how can i create a selection field in my form ?

i will be thanksfull

Please see developer doc on http://doc.openerp.com/v6.0/developer/2_5_Objects_Fields_Methods/field_type.html you need to made class with field type "fields.selection()" and add it to the view like this: <field name="water_source" colspan="1"/>. It's more than just simple. its simplest ;)

คำตอบที่ดีที่สุด

Yuri's solution didn't worked for me. Here is my solution.

Since you create the module with selections like below.

'gender': fields.selection(
        [('male', 'Male'), ('female', 'Female')],

I have added the below code in my template before the output of the field.

<%
   gndr = dict([('male', 'Male'), ('female', 'Female')])
   gndrout = str(gndr[o.gender]) 
%>

Then when displaying, put out the rendered field, as below.

<p>${ gndrout or "" |entity}</p>
อวตาร
ละทิ้ง
คำตอบที่ดีที่สุด

This is working for me:

http://www.omniasolutions.eu/OmniaSolutions/index.php?option=com_content&view=article&id=46%3Awebkit-selection-fields&catid=21%3Atechnical-momento&Itemid=30&lang=en

อวตาร
ละทิ้ง

That didn't worked for me. Below is my solution

Related Posts ตอบกลับ มุมมอง กิจกรรม
1
ส.ค. 16
11256
7
มี.ค. 15
6795
2
มี.ค. 15
8548
0
มี.ค. 15
3584
1
มี.ค. 15
3601