Overslaan naar inhoud
Menu
Je moet geregistreerd zijn om te kunnen communiceren met de community.
Deze vraag is gerapporteerd
1 Beantwoorden
3748 Weergaven

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
Annuleer
Auteur

have problem in page i try edit but page forbidden

Beste antwoord

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

Avatar
Annuleer
Gerelateerde posts Antwoorden Weergaven Activiteit
0
mrt. 15
4932
5
sep. 20
12893
1
sep. 19
4462
1
mrt. 15
5382
2
mrt. 15
7628