コンテンツへスキップ
メニュー
この質問にフラグが付けられました
1 返信
8225 ビュー

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;  });
アバター
破棄
著作者 最善の回答

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


アバター
破棄
関連投稿 返信 ビュー 活動
2
10月 19
12686
0
4月 16
26128
1
9月 20
5147
0
2月 19
6441
3
4月 18
31905