Skip to Content
Menu
This question has been flagged
1 Reply
3304 Views

Hello

I want to display all the values of my student model when an user choose a session 

I used onchange method but it's not working

@api.onchange('session_ids')
    def onchange_session_ids(self):
    list_student_ids=[]
    if self.session_ids:
        for each in self.session_ids:
            list_student_ids.append(each.id)
Avatar
Discard
Best Answer

Hi
Please check the following code

@api.onchange('session_ids')
def get_pack_details(self):
pack_id = self.env['model_name'].search([("id", 'in', self.session_ids.ids)])
self.update({'list_student_ids': pack_id})

Regards

Avatar
Discard