Help

0

How to call a postgres function with odoo-connect

Avatar
hector

Hi, im trying to connect node with odoo, and i have an stored procedure in postgres like a function, in the dbeaver i execute this function like `select * from public.myFunction()' But in node i have this but it doesnt works:


const express = require('express');
const app = express();
const Odoo = require('odoo-connect');


const odoo = new Odoo({
    host: 'MyHost',
    port: 8069
});

const config = {
    database: 'myDB',
    username: 'admin',
    password: 'admin'
}



let pruebaJr = async() => {
    return await odoo
        .connect(config)
        .then(partner => {
            return partner.call('res.partner', 'public.je_ver_tipos_negocio');
        }).then(partner => {
            return partner;
        });
}


pruebaJr().then(nuevo => {
    console.log(nuevo);
}).catch(err => {
    console.log('error al sacar los usuarios', err);
});

module.exports = app;


How can i solve this?? i need to call a postgres function, please, someone knows how
to do this?? thanks so much, im using odoo v13 community edition
Avatar
Discard