Hi,
How I can access variable value outside the .rpc .than in odoo12,
calculate_amount_1:function(points){
var fields={}
var order = this.pos.get_order()
var pos_order=order['name']
rpc.query({
model: 'res.partner',
method: 'get_redeem_price',
args: [[],[order],[pos_order]],
})
.then(function(values){
console.log("printing the values",values)
if(typeof values !== 'undefined'){
var pos_amount = values['amount_per_point']
points=values['points']
var select_amount = values['total_amount']
self.$(".point_to_use").text(points);
if(select_amount){
console.log('inside if',select_amount)
}
}
});
console.log("last amount",select_amount)
return select_amount
},
I couldn't value outside the .than..
when I print "select amount" value ..it is zero..
Thanks