I'm working with Odoo V12 and I need to override a function defined in a JS file and inject some code inside this function for changing a variable value.
The funcion I need to override is this one:
odoo.define('portal.signature_form', function (require){
"use strict";
require('web_editor.ready');
var ajax = require('web.ajax');
var base = require('web_editor.base');
var core = require('web.core');
var Widget = require("web.Widget");
var rpc = require("web.rpc");
var qweb = core.qweb;
var SignatureForm = Widget.extend({
template: 'portal.portal_signature',
events: {
'click #o_portal_sign_clear': 'clearSign',
'click .o_portal_sign_submit': 'submitSign',
'init #o_portal_sign_accept': 'initSign',
},
// some defined events
submitSign: function (ev) {
ev.preventDefault();
// some code
return rpc.query({
route: this.options.callUrl, <------------------
params: {
'res_id': this.options.resId,
'access_token': this.options.accessToken,
'partner_name': partner_name,
'signature': signature ? signature[1] : false,
},
}).then(function (data) {
// mode code
The objetive is to obtain a custom value and replace it for "route" variable.
I have defined my own JS file for doing it, first of all linking this file in a XML template and then writing my code, but I'm not able to modify the variable commented before.

Any suggestion?
