Hi - is it possible to execute SQL on the Odoo DB using the XML-RPC API, and if so, how?
I'm writing a little data retrieval script in PHP, and I can successfully get most of the data I need (from product.template etc) via ripcord and XML-RPC. I'd like to get the latest currency exchange rates stored in Odoo (from res.currency.rates), but this is not a simple query because we update the rates daily and I only want the latest for each active currency.
I can write an SQL query to rank the records by date and retrieve the latest , but it's not clear whether it's possible to execute the SQL - the ORM API docs (https://www.odoo.com/documentation/13.0/reference/orm.html#) only mention SQL by executing python code in the model, not via XML-RPC. I'm using Odoo 13.0.
Any ideas? If there's nothing else I could retrieve multiple recent rates from res.currency.rates (say a week's worth) and sort out what I want in PHP, but an SQL query would be convenient. Thanks!
Hi guys - thanks for your answers! I'm aware of directly connecting to the PostgreSQL database, but I wanted to avoid this for writing to the DB, and hence avoid it for reading as well, just to be consistent. I can easily make a workaround with XML-RPC - just have to stop thinking in SQL :)
I want to do a similar task. For us it's not possible to use native connections as the server is in the cloud, so is there a way to connect and query the Odoo database with Xml-RPC ?