Skip to Content
Menú
This question has been flagged
1 Respondre
10098 Vistes

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
Descartar
Best Answer

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
Descartar
Autor

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)?

Related Posts Respostes Vistes Activitat
0
de jul. 17
2721
0
de març 17
3108
3
de des. 23
21612
1
de maig 21
10144
1
d’ag. 18
9264