跳至内容
菜单
此问题已终结
1 回复
8161 查看

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.

最佳答案

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.

 


 

形象
丢弃
相关帖文 回复 查看 活动
5
8月 24
47938
2
4月 24
3345
3
6月 23
7506
2
6月 23
5656
3
3月 23
11048