Odoo Help


This community is for beginners and experts willing to share their Odoo knowledge. It's not a forum to discuss ideas, but a knowledge base of questions and their answers.


webkit report and selection field

on 3/11/13, 4:53 PM 2,377 views

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

on 4/1/13, 6:50 AM

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 A. Petrov
on 4/2/13, 10:15 AM
Erdem Uney
On 1/27/14, 2:19 PM

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>
Yuri A. Petrov
On 3/31/13, 1:17 PM

This is working for me:


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

7Gates Interactive Technologies, Erdem Uney
on 1/27/14, 1:22 PM

Your Answer

Please try to give a substantial answer. If you wanted to comment on the question or answer, just use the commenting tool. Please remember that you can always revise your answers - no need to answer the same question twice. Also, please don't forget to vote - it really helps to select the best questions and answers!

About This Community

This community is for professionals and enthusiasts of our products and services. Read Guidelines

Question tools

0 follower(s)


Asked: 3/11/13, 4:53 PM
Seen: 2377 times
Last updated: 3/16/15, 8:10 AM