Skip to Content
Meniu
Trebuie să fiți înregistrat pentru a interacționa cu comunitatea.
Această întrebare a fost marcată
1 Răspunde
3644 Vizualizări

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

Imagine profil
Abandonează
Autor

have problem in page i try edit but page forbidden

Cel mai bun răspuns

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

Imagine profil
Abandonează
Related Posts Răspunsuri Vizualizări Activitate
0
mar. 15
4797
5
sept. 20
12780
1
sept. 19
4335
1
mar. 15
5225
2
mar. 15
7444