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

Hello I would like to inherit JavaScript file gantt.js in web_gantt module.

My code is like that

openerp.mrp_smart_planning = function(instance){
    var module = instance.web_gantt;
    module.GanttView.include({
        init : function(){
            alert('Hello!');
            module._super();
        },
    });
};

(in file named mrp_smart_planning.js)

After reloading webpage, when I want to see gantt view "Hello" alert appear, but after shows windows with text below: Uncaught TypeError: Cannot read property '_model' of undefined

形象
丢弃

What are you trying to achieve.

编写者

I want modify gantt view

编写者 最佳答案

I found a solution.

openerp.mrp_smart_planning = function(instance){
var module = instance.web_gantt;
module.GanttView.include({
    init : function(view, node){
        alert('Hello!');
        this._super(view, node);
    },
});
};
形象
丢弃
最佳答案

Try with this:

openerp.mrp_smart_planning = function(instance){
var module = instance.web_gantt;
module.GanttView=module.GanttView.extend({
    init : function(){
        alert('Hello!');
        this._super();
    },
});

};

形象
丢弃
编写者

Unfortunately after applying your code error still appear. T_T

相关帖文 回复 查看 活动
0
9月 23
2162
1
8月 24
3048
1
5月 25
8085
1
11月 24
4731
0
5月 24
1933