Skip to Content
Menu
This question has been flagged
2 Replies
4595 Rodiniai

Greetings,

 

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 ?

Portretas
Atmesti
Best Answer

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

Portretas
Atmesti
Best Answer

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

 

 

Portretas
Atmesti