Download the PHP package obuchmann/laravel-odoo-api without Composer
On this page you can find all versions of the php package obuchmann/laravel-odoo-api. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Informations about the package laravel-odoo-api
Laravel Odoo Api
This is a medium level API to Odoo (former OpenERP) XMLRPC-API for Laravel. Odoo website
This package is a successor of Laradoo, but there is no backwards compatibility!
:warning: This Package is not Maintained any more. Successor is Odoo Jsonrpc
Compatibility
Laravel 7 and higher
Odoo 8.0 and higher
Php 7.4 and higher
Installation
This package is installed via Composer. To install, run the following command.
Publish the package's configuration file to the application's own config directory
This package supports autodiscover.
If you don't use autodiscover for reasons, you can add the provider as described below.
Register Laravel Odoo Api service by adding it to the providers array.
You can also add the Alias facade.
Configuration
After publishing the package config file, the base configuration for laravel-odoo-api package is located in config/laravel-odoo-api.php
Also, you can dynamically update those values calling the available setter methods:
host($url)
, username($username)
, password($password)
, database($name)
, apiSuffix($name)
Usage samples
Instance the main Odoo class:
You can get the Odoo API version just calling the version method:
This methods doesn't require to be connected/Logged into the ERP.
Connect and log into the ERP:
All needed configuration data is taken from laravel-odoo-api.php
config file. But you always may pass new values on the fly if required.
// Note:
host
should contain 'http://' or 'https://'
After login, you can check the user identifier like follows:
You always can check the permission on a specific model:
Permissions which can be checked: 'read','write','create','unlink'
Method `search provides a collection of ids based on your conditions:
You can limit the amount of data using limit
method and use as many as condition you need:
If need to get a list of models, use the get
method:
Instead of retrieving all properties of the models, you can reduce it by adding fields
method before the method get
If not sure about what fields a model has, you can retrieve the model structure data by calling fieldsOf
method:
Till now we have only retrieved data from Odoo but you can also Create and Delete records.
In order to create a new record just call create
method as follows:
The method returns the id of the new record.
For Deleting records we have the delete
method:
Notice that before calling
delete
method you have to usewhere
.
You can also remove records by ids like follows:
Update any record of your Odoo:
Notice that all delete
and update
methods always returns true
except if there was an error.
Custom api Calls are also supported