New

Just launched: Vueblocks, a brand-new search engine for Vue packages! Explore Vueblocks →

obuchmann/laravel-odoo-api

Laravel connector for Odoo
5,906 8

Larablocks Analysis

obuchmann/laravel-odoo-api works with Laravel 7 and 8 (latest release v0.5-beta, Feb 19, 2021), all past end of life (the last on Jan 24, 2023): no more fixes, even for security.

Recommendation checks

Not advised

Not advised: no release or commit in over 2 years.

  • No release or commit in over 2 years
  • Supports only Laravel 7 and 8, past end of life since Jan 24, 2023
  • No release in the last 12 months (last: Feb 19, 2021)
  • 48 downloads a month (needs 10,000)
  • 8 GitHub stars (needs 100)

State

Likely abandoned
  • No release or commit in over 2 years.
  • Last release (pre-release): Feb 19, 2021.
  • No releases in the last 12 months.
  • First released: Jan 29, 2021.
  • Monthly downloads: 48.
  • 0 open issues on GitHub.

Data from Packagist and GitHub, checked by Larablocks on Nov 28, 2026.

Install
composer require obuchmann/laravel-odoo-api:v0.5-beta
Latest Version:v0.5-beta
PHP:^7.4|^8.0
Laravel:7 · 8
License:MIT
Last Updated:Sep 2, 2022
Links: GitHub  ·  Packagist
Maintainer: obuchmann

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.

composer require obuchmann/laravel-odoo-api

Publish the package's configuration file to the application's own config directory

php artisan vendor:publish --provider="Obuchmann\LaravelOdooApi\Providers\OdooServiceProvider" --tag="config"

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.

'providers' => array(
        ...
        Obuchmann\LaravelOdooApi\Providers\OdooServiceProvider::class
    )

You can also add the Alias facade.

'aliases' => array(
        ...
        'Odoo' => Obuchmann\LaravelOdooApi\Facades\Odoo::class,
    )

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:

$odoo = new \Obuchmann\LaravelOdooApi\Odoo();

You can get the Odoo API version just calling the version method:

$version = $odoo->version();

This methods doesn't require to be connected/Logged into the ERP.

Connect and log into the ERP:

$odoo = $odoo->connect();

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.

$this->odoo = $this->odoo
            ->username('my-user-name')
            ->password('my-password')
            ->database('my-db')
            ->host('https://my-host.com')
            ->connect();

// Note: host should contain 'http://' or 'https://'

After login, you can check the user identifier like follows:

$userId = $this->odoo->getUid();

You always can check the permission on a specific model:

$can = $odoo->can('read', 'res.partner');

Permissions which can be checked: 'read','write','create','unlink'

Method `search provides a collection of ids based on your conditions:

$ids = $odoo
    ->model('res.partner')
    ->where('customer', '=', true)
    ->search();

You can limit the amount of data using limit method and use as many as condition you need:

$ids = $odoo
    ->model('res.partner')
    ->where('is_company', true)
    ->where('customer', '=', true)
    ->limit(3)
    ->search();

If need to get a list of models, use the get method:

$models = $odoo
    ->model('res.partner')
    ->where('customer', true)
    ->limit(3)
    ->get();

Instead of retrieving all properties of the models, you can reduce it by adding fields method before the method get

$models = $odoo
    ->model('res.partner')
    ->where('customer', true)
    ->limit(3)
    ->fields(['name'])
    ->get();

If not sure about what fields a model has, you can retrieve the model structure data by calling fieldsOf method:

$structure = $odoo
    ->model('res.partner')
    ->listModelFields();

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:

$id = $odoo
    ->model('res.partner')
    ->create(['name' => 'Bobby Brown']);

The method returns the id of the new record.

For Deleting records we have the delete method:

$result = $odoo
    ->model('res.partner')
    ->where('name', '=', 'Bobby Brown')
    ->delete();

Notice that before calling delete method you have to use where.

You can also remove records by ids like follows:

$result = $odoo
    ->model('res.partner')
    ->deleteById($ids);

Update any record of your Odoo:

$updateSuccessfull = $odoo
    ->model('res.partner')
    ->where('name', '=', 'Bobby Brown')
    ->update(['name' => 'Dagobert Duck','email' => 'daduck@odoo.com']);

Notice that all delete and update methods always returns true except if there was an error.

Custom api Calls are also supported

$ids = $odoo
    ->model('res.partner')
    ->setMethod('search')
    ->setArguments([[
        ['is_company', '=', true]
    ]])
    ->setOption('limit', 3)
    ->addResponseClass(Odoo\Response\ListResponse::class)
    ->get();

Related Packages

edujugon/laradoo

Odoo ERP API for Laravel

69,737 163
laragear/meta

A Laravel Package helper for Laravel Packages

1,478,913 7
cleaniquecoders/laravel-helper

Built with Laravel Standalone Package Creator

10,401 4
ipunkt/laravel-package-manager

Package Manager for laravel packages

1,756 2
wi-development/media

Admin's media

51 0

Version History

Pre-releases (6)
Version Released PHP Laravel License
v0.5-beta ^7.4|^8.0 ~7|~8 MIT
v0.4-beta ^7.4|^8.0 ~7|~8 MIT
v0.3-beta ^7.4|^8.0 ~7|~8 MIT
v0.2-beta ^7.4|^8.0 ~7|~8 MIT
v0.1-alpha.1 ^7.4|^8.0 ~7|~8 MIT