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

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

Avatar
Discard
Author

have problem in page i try edit but page forbidden

Best Answer

Can you put  your code for models so that one can understand your problem

Avatar
Discard
Related Posts Replies Views Activity
0
Mar 15
3878
5
Sep 20
11369
1
Sep 19
2815
1
Mar 15
4127
2
Mar 15
6104