Odoo Help

0

0
1 Answer
2
Avatar

Yenthe Van Ginneken

--Yenthe Van Ginneken--
22748
| 9 9 12
Turnhout, Belgio
--Yenthe Van Ginneken--

My Odoo training platform: https://www.oocademy.com
My Odoo blog: http://www.odoo.yenthevg.com/
My Twitter: https://twitter.com/Yenthe666

Yenthe Van Ginneken
08/04/19, 01:34

Hi Chaanto,

You're getting this error because you're trying to set the value 'Low Levy' into the field of the selection but it doesn't exist. Selections need the key to set the value and not the value. You could get all the values from this selection field though:

selection_values = self._fields['your_selection_field'].selection

Then convert it to a dictionary and from there on you have all values available with both their key and value:

atnd_types = dict(selection_values)

You can then get out the value paired to the key like this:

for key, value in atnd_types.items():
print('key: ' + str(key) + ' value: ' + str(value))

You can find more information about dictionaries and how they work in the Python docs https://docs.python.org/2/tutorial/datastructures.html#dictionaries

Regards,
Yenthe

1 Comment
Chaanto
08/04/19, 02:27

Hi Yenthe Van Ginneken,

Thanks for answering but low levy is exist and i already solve it but. another problem come out

Regards,

Chaanto

Ask a Question
Writer
Keep Informed
1 follower(s)
About This Community

This platform 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.

Register
Odoo Training Center

Access to our eLearning platform and experience all Odoo Apps through learning videos, use cases and quizzes.

Test it now