Odoo Help


change selection field from function

on 12/10/14, 3:19 AM 933 views



Im trying to change the selection field once other many2one has beed changed .

the problem is : i can't change the values of the selection field with return statment , many errors i face some of them like wrong values , unhashable dict and many others .

what i want to do is :

i have many2one selection field , which the values contain all countries , on change , i have other selection field i want to but on it all customers on the selected country .

so the problem is in ' customers ' selection field , i loaded every thing but i need to add the selected customers to the selection field .


any help ?




| 5 3 6
Jakarta, Indonesia
On 12/10/14, 3:33 AM

I would advise you to read the answer to this question: https://www.odoo.com/forum/help-1/question/best-practices-as-to-when-to-use-fields-selection-vs-fields-many2one-69262 also the discussion in this question: https://www.odoo.com/forum/help-1/question/how-to-update-selection-field-on-wizard-based-on-another-fied-value-68543

On 12/10/14, 3:30 AM

I will give you some tips..

1st thing is you have to use below func in your many2one field's table

 def name_get(self, cr, uid, ids, context=None):

     ###some code to filter your values###

     return the result



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.


Odoo Training Center

Access to our E-learning platform and experience all Odoo Apps through learning videos, exercises and Quizz.

Test it now

Question tools

1 follower(s)


Asked: 12/10/14, 3:19 AM
Seen: 933 times
Last updated: 3/16/15, 8:10 AM