跳至內容
選單
此問題已被標幟
1773 瀏覽次數

I have read many posts but cannot seem to figure out how to solve this.

So there is a base js module like so

odoo.define('module_a', function (require) {

class ModuleA {

_setValue(val) {
// method logic

return

}

}


return ModuleA;

});


A second module, module_b extending the base module...

odoo.define('module_b', function (require) {

const ModuleA = require('module_a');


class ModuleB extends ModuleA {

_setValue(val) {
// method logic

return super._setValue(val)

}

}


return ModuleB;

});



A third module, module c...

odoo.define('module_c', function (require) {

const ModuleB = require('module_b');


class ModuleC extends ModuleB {
_setValue(val) {
// method logic

return super._setValue(val)

}

}


return ModuleC;

});


in the manifest, module b depends on pos. My aim is to make the "super._setValue(val)" in module c to refer to module a not module b. In other words, I just want to overwrite that method in moduleb. That is not the case even when i "require" module a in module c or depend on pos in the manifest.

At the moment I just commented out the method in module b but I wonder how this can be achieved.

頭像
捨棄
相關帖文 回覆 瀏覽次數 活動
0
7月 25
313
1
7月 25
5107
0
7月 25
669
0
6月 25
727
1
6月 25
900