İçereği Atla
Menü
This question has been flagged
1 Cevapla
7619 Görünümler

Hi i have a js in a module called odoo.define('custom1')  in that i have a backbone model like below.

i need to extend the initialize function in my custom module js.I can get the "somename" by adding require("custom1") but cant access the initialize function.


odoo.define('custom1', function(require){
var exports ={}
     exports.somename = Backbone.Model.extend({
initialize: function(test){         //some code }, });
return exports;  });
Avatar
Vazgeç
Üretici Best Answer

Sorry I got it, i solved it like this 


var test = require("custom1");
odoo.define("test3",function (require) { var Supercustom1 = test.somename;

test.somename = test.somename.extend({
    initialize:function(){     //calling super if you want     Supercustom1.prototype.initialize.apply(this, arguments); }, }) })


Avatar
Vazgeç
Related Posts Cevaplar Görünümler Aktivite
2
Eki 19
11810
0
Nis 16
25324
1
Eyl 20
4288
0
Şub 19
5388
3
Nis 18
30622