Can anyone help me? I'm doing a query using RPC, but I can't extract the data, follow the code:
nfce_return_invoice: function(name){
return rpc.query({
model: 'pos.order',
method: 'search_invoice',
args: [{'name': name}]
},{timeout: 30000}).then(function (invoice) {
return invoice;
});
},
nfce_variaveis: function (obj) {
var self = this;
const invoice = self.pos.nfce_return_invoice(obj.order.name);
console.log(invoice);
},
what's coming out of console.log is this:
{state: ƒ, always: ƒ, then: ƒ, promise: ƒ, pipe: ƒ,…}