コンテンツへスキップ
メニュー
この質問にフラグが付けられました
2 返信
7168 ビュー

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
2340
1
8月 24
3198
1
5月 25
8260
1
11月 24
4955
0
5月 24
2119