OpenERP Home Action&菜单操作

时间:2013-05-13 08:40:29

标签: openerp

我正在尝试自定义用户主页但到目前为止没有成功。

我在“Home Action”和“Menu Action”字段中都尝试了一些值,但我总是在启动时收到消息传递源。

我该如何自定义???

提前致谢

2 个答案:

答案 0 :(得分:0)

“主页操作”和“菜单操作”功能不适用于Web客户端。你可以看到为什么here。 但您可以更改菜单项中的序列号。最小的序列号首先调用。

答案 1 :(得分:0)

Please check this answer > https://launchpadlibrarian.net/155202728/patch.txt
For OpenERP 7.0
I have edited my chrome.js file  as show below and this patch works 

Added the Following code

//patch in function show_application



self.user_action_id = false ;
instance.web.blockUI();

var func = new instance.web.Model("res.users").get_func("read");
var home_action = func(self.session.uid, ['action_id']).then(function(result)
{
     action_id = result['action_id']
    if (action_id)
       {
           self.user_action_id = action_id[0]
            instance.web.unblockUI()
            self.bind_hashchange();
      }
     else{
            instance.web.unblockUI()
            self.bind_hashchange();
        }
    })
        // end of patch

****then replace contents in**** 


     self.menu.has_been_loaded.done(function() 
                {
                    var first_menu_id = self.menu.$el.find("a:first").data("menu");
                    if(first_menu_id) {
                        self.menu.menu_click(first_menu_id);
                    }
                });

**with below code.**



    self.menu.has_been_loaded.done(function() 
    {

        if (self.user_action_id){
                    self.action_manager.do_action(self.user_action_id, {'clear_breadcrumbs': true})
                    }
                    else{
                        var first_menu_id = self.menu.$el.find("a:first").data("menu");
                        if(first_menu_id) {
                            self.menu.menu_click(first_menu_id);
                        }
                     }
                 });