跳至內容
選單
此問題已被標幟
2 回覆
7027 瀏覽次數

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
2164
1
8月 24
3049
1
5月 25
8091
1
11月 24
4735
0
5月 24
1934