我正在尝试自定义用户主页,但到目前为止没有成功。
我在“主页操作”和“菜单操作”字段中都尝试了一些值,但我总是在启动时收到消息源。
我怎样才能自定义这个???
提前致谢
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);
}
}
});
主页操作和菜单操作功能不适用于 Web 客户端。你可以在这里看到为什么。但是您可以更改菜单项中的序列号。最小的序号首先调用。