Passa al contenuto
Menu
È necessario essere registrati per interagire con la community.
La domanda è stata contrassegnata
1 Rispondi
10200 Visualizzazioni

Is it possible to get current(active) view xml_id in python, lets say on onchange method, or on button press? I know its possible to get menu_id but i could find any relation between xml_id and menu_id

Avatar
Abbandona
Risposta migliore

I think it may help you:


@api.multi   

def get_view_name(self):
        a = 0       

        view_id = self.env['ir.ui.view'].search([('model', '=', self._inherit), ('type', '=', 'form')])       

         for i in view_id:
                 a += 1       

         if a == 2:
                print "Live Xml Id Is", i.xml_id


Avatar
Abbandona
Autore

It is not what im looking for, what it does here it gets all form views from inherited model, but how to know which one is currently active(showing on screen)?

Post correlati Risposte Visualizzazioni Attività
0
lug 17
2822
0
mar 17
3179
3
dic 23
21734
1
mag 21
10258
1
ago 18
9426