Skip to Content
Menu
This question has been flagged

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
Related Posts Replies Views Activity
1
May 20
2973
2
Feb 20
4783
0
Jan 20
2660
0
Dec 19
2978
1
Jun 24
2347