Skip to Content
Menu
This question has been flagged
2924 Views

Hi,

I have a function with rpc query which takes a values from python. I got the values from python function to js using rpc query. But when return in js and when this fuction is calling to another function in js i got an undefined value. Actually I need project name but when I printing the value is showing as 'undefined'. I will give the code here.


getting_orders: function(){
var self = this;
rpc.query({
model: 'pos.order',
method: 'get_session_lines',
  }).then(function (result) {
var lines = result[0];
for(var j=0;j < lines.length; j++){
var product_line = lines[j];
var name =product_line.product;
console.log(name)
}
return name;
});
},

Actually when i call this function in another function i need to get values in the name(ie product__line.product).

Avatar
Discard