i need clarity about _super
in JS.
I tried to inherit a widget and call a super method. I tried a different way to super the function. Only one way got worked. But when analysing the Odoo source code we can see other methods are used for supering a method. I need to know why Odoo uses different super methods at different times.
Here is my sample code:
*.js
odoo.define('pos_session_route.payment', function (require) {
"use strict";
var account_payment = require('account.payment');
var AbstractField = require('web.AbstractField');
var core = require('web.core');
var field_registry = require('web.field_registry');
var QWeb = core.qweb;
var _t = core._t;
console.log('paymenyyyyy',account_payment);
account_payment.ShowPaymentLineWidget.include({
// AbstractField.include({
payment_widget : function () {
console.log('paymenyyyyy');
},
_render:function(){
console.log('hihooo');
// account_payment.prototype._super.apply(this.arguments); didn't work
// account_payment.ShowPaymentLineWidget.prototype._super.apply(this.arguments); didn't work
// this._super.apply(this, arguments);didn't work
this._super(this.arguments); it works
}
})
});