Zum Inhalt springen
Menü
Sie müssen registriert sein, um mit der Community zu interagieren.
Diese Frage wurde gekennzeichnet
1 Antworten
8167 Ansichten

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
Verwerfen

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.

Beste Antwort

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
Verwerfen
Verknüpfte Beiträge Antworten Ansichten Aktivität
5
Aug. 24
47943
2
Apr. 24
3350
3
Juni 23
7516
2
Juni 23
5657
3
März 23
11050