I'm trying to create a task from the notification popup and then redirect to that task. The problem is that I'm bad at javascript. I've created a controller that creates a task and returns its ID. Now I want to get an action by xml ID, append the task ID as res_id to it and redirect to it. The controller creates the task and returns the task ID, but when I call the next controller I get an error "TypeError: this.rpc is not a function".
this.rpc("/calls/create/task", {
call_id: eid,
}).then(function(r) {
this.task_id = r;
console.log('pride v drugi rpc')
return this.rpc("/web/action/load", {action_id: "tabla_asterisk_calls.action_show_call_ticket"});
}).then(function(a){
a.res_id = self.task_id;
return self.do_action(a);
});