Zum Inhalt springen
Menü
Sie müssen registriert sein, um mit der Community zu interagieren.
Diese Frage wurde gekennzeichnet
2 Antworten
7187 Ansichten

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
Verwerfen

What are you trying to achieve.

Autor

I want modify gantt view

Autor Beste Antwort

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
Verwerfen
Beste Antwort

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
Verwerfen
Autor

Unfortunately after applying your code error still appear. T_T

Verknüpfte Beiträge Antworten Ansichten Aktivität
0
Sept. 23
2389
1
Aug. 24
3211
1
Mai 25
8285
1
Nov. 24
4999
0
Mai 24
2141