【发布时间】:2012-02-07 16:51:30
【问题描述】:
我正在寻找一种方法来覆盖一些 openerp web js 核心功能,例如“on_logout”。
文档缺少说明(如您在 my post 中所见),而 helloworld module 告诉您可以这样做
openerp.web_hello = function(openerp) {
openerp.web.SearchView = openerp.web.SearchView.extend({
init:function() {
this._super.apply(this,arguments);
this.on_search.add(function(){console.log('hello');});
}
});
// here you may tweak globals object, if any, and play with on_* or do_* callbacks on them
openerp.web.Login = openerp.web.Login.extend({
start: function() {
console.log('Hello there');
this._super.apply(this,arguments);
}
});
};
在我的模块中,我正在这样做:
openerp.mytest = function(openerp){
openerp.web.WebClient = openerp.web.WebClient.extend({
on_logout: function() {
alert('mine');
[...]
},
});
}
我知道 js 已加载,因为在此定义之外放置警报有效。
这里有什么问题?
【问题讨论】:
标签: client web webclient openerp