Skip to Content
Menu
This question has been flagged
1 Reply
952 Views
I want to get a field to change its domain given a condition, this is not working for me, it duplicates the fields



                 
                  
                             
                        

                    
 
                         
                             
                             
                         
                     

Avatar
Discard
Best Answer

Hi Pavel,

I am not sure how you did your implementation, but you can make the domain dynamic with onchange function, such as:

@api.onchange('type') 
def onchange_type(self): 
​for rec in self: return {'domain': {'category_id': [('type', '=', rec.type)]}}

Or please try to share your code with us :)

Sincerely

Ivana from edoo.is

Avatar
Discard