Odoo Help

Welcome!

This community is for beginners and experts willing to share their Odoo knowledge. It's not a forum to discuss ideas, but a knowledge base of questions and their answers.

0

How do get the current view mode?

By
AJ Schrafel Paper Corp
on 7/29/13, 2:57 AM 1,426 views

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.

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.

Brett Lehrer
on 9/13/14, 12:39 PM
0
Kuldeep Jadeja
On 9/12/14, 10:12 AM

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.

 


 

Your Answer

Please try to give a substantial answer. If you wanted to comment on the question or answer, just use the commenting tool. Please remember that you can always revise your answers - no need to answer the same question twice. Also, please don't forget to vote - it really helps to select the best questions and answers!

About This Community

This community is for professionals and enthusiasts of our products and services. Read Guidelines

Question tools

1 follower(s)

Stats

Asked: 7/29/13, 2:57 AM
Seen: 1426 times
Last updated: 3/16/15, 8:10 AM