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.


Retrieving the keys from the selection field

Odoo Programmer
on 12/30/15, 5:06 PM 252 views


I currently have a selection field with multiple locations.  Each location is to be assigned a number.  Both of the locations and location number are viewed by the user.  What I am trying to do is that when the user chooses a location (e.g. Dublin), a location number is automatically assigned to it (e.g. 123).

I have tried doing the back end logic using Alessandro Ruffolo's suggestion here:


but this has not worked out with me.  I have made the variable where I want to output the location number a compute field.  I also tried adding a loop and placing conditions in the loop (e.g. if location = 'Dublin', location_number = 123), but it still does not work out the way I want.

Is there a way, whereby I can capture the key in the selection field and thereby assign the proper location number and output it to the user and that it keeps updating the location number as the user selects different locations?


Any suggestions?

Odoo Programmer
on 1/4/16, 8:56 AM

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

1 follower(s)


Asked: 12/30/15, 5:06 PM
Seen: 252 times
Last updated: 12/31/15, 8:22 AM