Download the PHP package winternet-studio/odoo-jsonrpc-client without Composer
On this page you can find all versions of the php package winternet-studio/odoo-jsonrpc-client. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download winternet-studio/odoo-jsonrpc-client
More information about winternet-studio/odoo-jsonrpc-client
Files in winternet-studio/odoo-jsonrpc-client
Package odoo-jsonrpc-client
Short Description A simple Odoo JSON-RPC client you can understand
License MIT
Informations about the package odoo-jsonrpc-client
php-odoo-jsonrpc-client
A simple Odoo JSON-RPC client you can understand - and with examples. Written in PHP.
Let's just put the truth out there - Odoo's API documentation is terrible... if you can even find any! But with this library I'll try to make it a little less terrible to work with its API.
It's currently a work in progress. Feel free to help by doing pull requests.
Installation
The preferred way to install this extension is through composer.
Usage
Connecting to Odoo:
Continue with examples below and see the documentation for each method in the JsonRpcClient class file itself.
Examples
A very useful way of figuring out the possible requests, methods, fields and possible values is to look at the requests the browser makes when navigating the Odoo system. Open the developer tools and look at the Network requests.
Depending of Odoo version the fields might differ. These examples work for v14.
Get all models
Get all fields for a model
Get records by ID
Post a record that is currently a draft
Eg. post a payment (account.payment
) or invoice (account.move
).
Get invoices
Create invoice
This invoice example is originally a copy from the network request in the browser.
It is created as a draft and must be posted using the actionPost()
method as in the example above.
Seems not possible to post it at the same time as creating it.
Create payment
Get currencies
Get currencies, with array index values being the currency code.
Update currencies with today's rates
Update rates with data from European Central Bank.