İçereği Atla
Menü
Bu soru işaretlendi
1 Cevapla
8153 Görünümler

I want to have a function that returns wether the user is in tree or form view. How do i get the current view mode?

    def action_button_get_view(self, cr, uid, ids, context=None):
        if context is None:
            context = {}
        mode = context.get('view_mode')
        _logger = logging.getLogger('test_func')
        _logger.info("view mode is  %s" % mode)
return True

my function just returns None.

Avatar
Vazgeç

That info is stored in the client JS, you'd have to edit that to allow appending more of the client state to the context before an RPC command.

En İyi Yanıt

I get 4 as resulting value.

I also can't figure out what the hell is happening, Though I'm a completely a Newbie in Openerp and in professional IT/ERP field.

 


 

Avatar
Vazgeç
İlgili Gönderiler Cevaplar Görünümler Aktivite
5
Ağu 24
47913
2
Nis 24
3323
3
Haz 23
7472
2
Haz 23
5635
3
Mar 23
11038