Skip ke Konten
Menu
Pertanyaan ini telah diberikan tanda
2 Replies
7025 Tampilan

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

Avatar
Buang

What are you trying to achieve.

Penulis

I want modify gantt view

Penulis Jawaban Terbai

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);
    },
});
};
Avatar
Buang
Jawaban Terbai

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();
    },
});

};

Avatar
Buang
Penulis

Unfortunately after applying your code error still appear. T_T

Post Terkait Replies Tampilan Aktivitas
0
Sep 23
2164
1
Agu 24
3048
1
Mei 25
8089
1
Nov 24
4734
0
Mei 24
1934