Skip to Content
Menu
Musisz się zarejestrować, aby móc wchodzić w interakcje z tą społecznością.
To pytanie dostało ostrzeżenie
4429 Widoki

Hello,

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:

https://www.odoo.com/forum/help-1/question/how-to-use-the-value-of-a-selection-field-instead-of-its-key-in-a-python-function-39080

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?

Thanks.


Awatar
Odrzuć
Autor

Any suggestions?

Powiązane posty Odpowiedzi Widoki Czynność
0
mar 16
3386
2
sie 22
14275
1
kwi 19
4489
1
cze 18
3902
5
sty 24
14965