コンテンツへスキップ
メニュー
この質問にフラグが付けられました
1 返信
10204 ビュー

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

アバター
破棄
最善の回答

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


アバター
破棄
著作者

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

関連投稿 返信 ビュー 活動
0
7月 17
2830
0
3月 17
3181
3
12月 23
21737
1
5月 21
10260
1
8月 18
9430