Download the PHP package codebar-ag/laravel-odoo without Composer
On this page you can find all versions of the php package codebar-ag/laravel-odoo. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download codebar-ag/laravel-odoo
More information about codebar-ag/laravel-odoo
Files in codebar-ag/laravel-odoo
Package laravel-odoo
Short Description A simple way to interact with the Odoo API in Laravel
License MIT
Homepage https://github.com/codebar-ag/laravel-odoo
Informations about the package laravel-odoo
This package was developed to give you a quick start to communicate with the Odoo external API from Laravel. It wraps the most common endpoints — sessions, users, employees, projects, tasks and timesheets — behind a clean, typed connector built on Saloon.
⚠️ This package is not designed as a replacement of the official Odoo external API. See the Odoo documentation if you need further functionality. ⚠️
📑 Table of Contents
- What is Odoo?
- Requirements
- Installation
- Configuration
- Environment Variables
- Basic Usage
- API Reference
- Session
- User
- Employees
- Fields
- Permissions
- Projects
- Tasks
- Timesheets
- Bank Accounts
- Sync All
- DTOs
- Testing
- Changelog
- Contributing
- Security Vulnerabilities
- Credits
- License
💡 What is Odoo?
Odoo is an open-source suite of business applications covering CRM, sales, project management, timesheets, accounting, inventory and more. It exposes an external API that lets you read and write records across all of these modules. This package provides a typed, Laravel-friendly client for the most common Odoo endpoints used in day-to-day integrations.
🛠 Requirements
| Package | PHP | Laravel |
|---|---|---|
| v1.0.0 | ^8.4 | ^13.0 |
⚙️ Installation
You can install the package via composer:
🔧 Configuration
Optionally publish the config file to adjust defaults:
You can generate an API key in your Odoo user profile under Preferences → API Keys.
Environment Variables
Add the following variables to your .env file:
🚀 Basic Usage
Create an OdooConnector instance with your Odoo URL, API key, and optionally a database name:
Each method returns a typed response object with dedicated methods for accessing the data.
Using the Facade
If you set the environment variables above (or publish and edit the config file), the package binds a pre-configured OdooConnector in the container, so you can resolve it or use the Odoo facade instead of constructing it by hand:
The facade reads url, api_key, db, timeout, and max_redirects from config/laravel-odoo.php (configurable via their respective LARAVEL_ODOO_* env vars). Direct instantiation with new OdooConnector(...) remains fully supported — for example when you need to talk to more than one Odoo instance.
📖 API Reference
Session
User
Employees
Fields
Permissions
Projects
Tasks
Timesheets
Bank Accounts
CRUD and search operations for the res.partner.bank model.
Odoo 19.0 vs 19.3: Odoo renamed the bank-account fields in 19.3 (
acc_number→account_number,acc_holder_name→holder_name, and thebank_id/currency_idrelations were dropped). The connector detects the server version once (cached) and transparently uses the right field names for reads and writes, so the API below is the same on both. Read DTOs always expose the classic property names (accNumber,accHolderName, …). To skip the version lookup, force it with$connector->withBankAccountSchema(modern: true).
Sync All
Fetch projects, all tasks, and all timesheet entries in one call:
📦 DTOs
Read DTOs are built on spatie/laravel-data.
Odoo's relation tuples ([id, name]) are flattened onto paired properties
(e.g. projectId / projectName) and its false-means-empty sentinel is
normalised to null. Each DTO keeps a fromArray() factory for backwards
compatibility and is also a full laravel-data Data object (from(), collect(), …).
| DTO | Description |
|---|---|
ProjectDto |
Represents an Odoo project |
TaskDto |
Represents an Odoo task |
TimesheetEntryDto |
Represents a timesheet entry (read) |
CreateTimesheetDto |
Payload for creating a timesheet entry |
UpdateTimesheetDto |
Payload for updating a timesheet entry |
EmployeeDto |
Represents an Odoo employee |
UserDto |
Represents the authenticated Odoo user |
FieldDto |
Represents a field definition on an Odoo model |
🧪 Testing
For live integration tests against a real Odoo instance, copy phpunit.xml.dist to phpunit.xml, fill in the LARAVEL_ODOO_URL, LARAVEL_ODOO_API_KEY and LARAVEL_ODOO_DB env values, then run:
📝 Changelog
Please see CHANGELOG for more information on what has changed recently.
✏️ Contributing
Please see CONTRIBUTING for details.
🧑💻 Security Vulnerabilities
Please review our security policy on how to report security vulnerabilities.
🙏 Credits
- Sebastian Bürgin-Fix
- Tobias Brogle
- All Contributors
- Skeleton Repository from Spatie
- Laravel Package Training from Spatie
🎭 License
The MIT License (MIT). Please see License File for more information.
All versions of laravel-odoo with dependencies
illuminate/contracts Version ^13.0
saloonphp/laravel-plugin Version ^4.0
saloonphp/saloon Version ^4.0
spatie/laravel-data Version ^4.23
spatie/laravel-package-tools Version ^1.16