Setup
- Go to Project Settings → Project Integrations
- Select Odoo from the list
- Enter your Odoo credentials:
- Odoo Instance URL - Your Odoo instance URL (e.g.,
https://your-instance.odoo.com) - Database Name - Your Odoo database name
- Username - Your Odoo username
- Password/API Key - Your Odoo password or API key
- User ID (UID) - Click “Authenticate” to automatically get your UID
- Odoo Instance URL - Your Odoo instance URL (e.g.,
- Test the connection
- Start using Odoo in your prompts
How It Works
HelloLeo uses the Odoo MCP (Model Context Protocol) to interact with your Odoo instance. Your credentials are encrypted and stored securely on the backend.HelloLeo Middleware
When HelloLeo creates a frontend application connected to Odoo, all API requests are automatically routed through the HelloLeo Middleware. This middleware acts as a secure proxy between your frontend and Odoo, providing several important benefits:How It Works
- Frontend makes request - Your HelloLeo-generated frontend sends API requests to the HelloLeo Middleware
- Middleware forwards request - The middleware forwards the request to Odoo using your stored API credentials
- Odoo responds - Odoo processes the request and sends a response back through the middleware
- Frontend receives data - The response is returned to your frontend application
Benefits
- No CORS Issues - Requests work immediately without CORS configuration. The middleware handles all cross-origin requests seamlessly.
- Secure API Keys - Your Odoo API keys are encrypted and stored securely on the backend. They’re never exposed to the frontend or end users.
- Automatic Authentication - The middleware automatically includes your Odoo credentials in every request, so you don’t need to manage authentication in your frontend code.
- Permission Management - (Coming soon) You’ll be able to manage permissions and access control through the middleware, giving you fine-grained control over what data each user can access.
Technical Details
The middleware:- Encrypts and stores your Odoo credentials securely
- Handles Odoo’s JSON-RPC protocol automatically
- Manages session authentication and MFA
- Provides a consistent API interface for your frontend
- Logs all requests for debugging (visible in Network Monitor)
MCP Operations
execute_method
A generic tool that executes any method on any Odoo model.
Parameters:
model(required): The Odoo model name (e.g.,'res.partner','sale.order','product.product')method(required): The method name to execute (e.g.,'search','read','create','write','unlink','search_read','search_count')args(optional): List of positional argumentskwargs(optional): Dictionary of keyword arguments
success: Boolean indicating success/failureresult: The method result (if successful)error: Error message (if failed)
- Domain normalization for search methods (
search,search_count,'search_read') - Supports multiple domain formats (lists, dictionaries with conditions, JSON strings)
- Handles Odoo domain operators (
&,|,!)
Common Methods
Search Records
search: Find records by domainsearch_read: Search and read in one callsearch_count: Count records matching domain
Read Records
read: Get record details by IDs
Create Records
create: Create new records
Update Records
write: Update existing records
Delete Records
unlink: Delete records
Custom Methods
- Any custom method defined on the model
Example Usage
Search and Display Products
Create a Customer
Update an Order
Search Partners
Example MCP Command
Authentication
Admin Authentication (Setup)
When configuring the Odoo integration in HelloLeo, you authenticate using an admin or technical user account. This account is used by the HelloLeo Middleware to make API calls on behalf of your application. The integration supports Odoo’s Multi-Factor Authentication (MFA). When you authenticate, if MFA is enabled, you’ll be prompted to enter your MFA code. Important: The credentials you provide during setup are encrypted and stored securely. They’re used by the middleware to authenticate all API requests, but are never exposed to your frontend code or end users.Portal User Authentication
When building customer portals or frontend applications with HelloLeo, you can implement portal user authentication so that end users (customers, vendors, etc.) log in with their own Odoo portal accounts.How Portal Authentication Works
- Portal User Login - End users log in using their Odoo portal credentials (email/password) through your HelloLeo-generated frontend
- Session Creation - The frontend authenticates with Odoo’s
/web/session/authenticateendpoint through the HelloLeo Middleware - Session Management - Odoo returns a session ID that identifies the portal user
- Data Access - All subsequent API requests use this session to access data according to the portal user’s permissions in Odoo
Implementing Portal Authentication
When building a portal, ask Leo to:Portal User Permissions
Portal users in Odoo have limited access based on:- Record Rules - Odoo’s record-level security rules
- Access Rights - Model-level read/write permissions
- Portal Groups - Portal user group membership
Security Considerations
- Portal users authenticate directly with Odoo, not with HelloLeo
- Session data is managed securely through the middleware
- All Odoo security rules and permissions are enforced
- API keys used by the middleware are separate from portal user sessions
Best Practices
- Be specific about models - Always mention which Odoo model you’re working with (e.g., “products”, “customers”, “orders”)
- Specify fields - Tell Leo which fields to display or update
- Use domain filters - Describe what records you want to find (e.g., “active products”, “confirmed orders”)
- Mention the integration - Always say “from Odoo” or “to Odoo” so Leo knows which integration to use
Troubleshooting
Authentication Issues
- Check credentials - Verify your URL, database name, username, and password are correct
- MFA enabled - If MFA is enabled, make sure to complete the MFA verification
- UID missing - Click “Authenticate” to get your User ID
Data Not Showing
- Check model name - Ensure you’re using the correct Odoo model name
- Verify permissions - Make sure your user has access to the model and records
- Check domain - Review your search criteria
