Skip to content

Error calling a postgres function #1

@HectorMG02

Description

@HectorMG02

Hi, i have a postgres function in my db, im using dbeaver and i have my function which is something like this:

CREATE OR REPLACE FUNCTION public.jr_ver_res_partner_4()
 RETURNS TABLE(myData)
 LANGUAGE plpgsql
AS $function$
	BEGIN
		return query select * from res_partner rp where RP.ID=4;
	END;
$function$;

it works in my sql execute, but in my website im trying to call this function with something like this:

// Connect to Odoo
odoo.connect(function(err) {
    if (err) { return console.log(err); }

    console.log('conectado a odoo');

    // View Delivery Order
    odoo.rpc_call('public.jr_ver_res_partner_4()', '', function(err, result) {
        if (err) {
            console.log(err);
            return;
        }
        console.log(result);

    });
});

But it doesnt work, i recive a 404 code, how can i call one of my functions?? in the sql i execute it like this:

SELECT * FROM public.MyFunction()

but with node-odoo it doesnt works, what can i do?? thanks so much

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions