Skip to Content
Menu
This question has been flagged
2 Replies
7143 Rodiniai

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

Portretas
Atmesti

What are you trying to achieve.

Autorius

I want modify gantt view

Autorius Best Answer

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);
    },
});
};
Portretas
Atmesti
Best Answer

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

};

Portretas
Atmesti
Autorius

Unfortunately after applying your code error still appear. T_T

Related Posts Replies Rodiniai Veikla
0
rugs. 23
2315
1
rugp. 24
3190
1
geg. 25
8245
1
lapkr. 24
4934
0
geg. 24
2092