Skip to Content
Meniu
Trebuie să fiți înregistrat pentru a interacționa cu comunitatea.
Această întrebare a fost marcată
1 Răspunde
8215 Vizualizări

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;  });
Imagine profil
Abandonează
Autor Cel mai bun răspuns

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


Imagine profil
Abandonează
Related Posts Răspunsuri Vizualizări Activitate
2
oct. 19
12684
0
apr. 16
26122
1
sept. 20
5144
0
feb. 19
6439
3
apr. 18
31896