i have field name name_stage_id Many2one from class mk.stage in same class have field level_id Many2many relation class mk.levels any stage have select multi level i want filter level based on stage i used @api.onchange('name_stage_id'):
@api.onchange('name_stage_id')
def onchange_levels(self):
res = {}
ids = []
all_stage = self.search([])
"""
for level_rec in all_stage:
print level_rec, '?????????????????'
if level_rec.level_id == self.name_stage_id.level_ids:
ids.append(level_rec.id)
res['domain'] = {
'level_id': [('id', 'in', ids)],
}
return res
"""
my problem in all_stage hold one id so res return one id just how to solve this to return ids in Level_id
have problem in page i try edit but page forbidden