Contributors mailing list archives

contributors@odoo-community.org

Browse archives

Avatar

odoo rpc: I have a model, want a cursor to execute a raw sql query

by "robert@redo2oo.ch" <robert@redo2oo.ch> - 26/02/2017 16:34:38
I there,

I have a model i get like this:

users = odoo.env['res.users']

now I would like go get a live cursor, so I can execute an sql query.

something like:

   query = 'select res_user.id from from res_usr, res_partner where ....'

   cursor = user.get_cursor()

   cursor.execute(query)

any idea how to do that (without accessing the db directly fromp sycopg2) ?

thanks

robert