Yes, integrating Odoo with the open-source Universal Medical Hub (UMH)
application is feasible due to Odoo's robust API capabilities and modular
architecture.
Integration Methods
Odoo supports API-based connections (RESTful or XML-RPC) for real-time
data exchange with third-party apps like UMH, which handles medical device
data and FHIR standards.
Custom modules or connectors can sync patient records, device telemetry, or
appointments bidirectionally, using one-way or two-way flows depending on
needs.
Flat-file imports serve as a simpler fallback for batch data transfers if APIs
aren't immediately viable.
Key Considerations
Both systems being open-source allows for tailored development, such as
Python scripts leveraging Odoo's external API to pull UMH data into custom
healthcare models.
Challenges may include mapping medical data fields (e.g., FHIR to Odoo's
patient modules) and ensuring HIPAA/GDPR compliance via secure
endpoints.
Start with Odoo's connector framework or third-party tools for prototyping,
then scale to high-volume syncs
UMH, or United Manufacturing Hub, is an open-source industrial data
management platform designed for manufacturing environments.
Core Functionality
It creates a Unified Namespace (UNS) that centralizes data from factory
devices like PLCs, sensors, and MES systems using protocols such as OPC UA,
Modbus, and REST APIs.
UMH Core runs as a lightweight Docker container bundling tools like
Redpanda (messaging broker), Benthos (stream processor), and an agent for
configuration and monitoring.
Data enters via "bridges," gets validated and organized into topics, then
becomes accessible for analytics, dashboards, or AI applications without
point-to-point integrations.
Deployment Options
Choose UMH Core for edge devices (single container) or the full Helm chart
for Kubernetes-based enterprise setups with storage and visualization.
The Management Console provides a cloud UI for remote deployment,
configuration, and updates across multiple instances.
It's 100% open-source, supporting outputs to MQTT, Kafka, SQL databases,
and cloud services like AWS or Azure.
Odoo natively supports API-based connections through two primary protocols:
XML-RPC (default legacy method) and RESTful APIs (via official modules or
custom extensions). These enable external apps to perform CRUD operations,
authentication, and complex business logic calls on Odoo models.
XML-RPC Protocol (Native)
Odoo's core provides XML-RPC endpoints out-of-the-box at [Link]
server/xmlrpc/2/*, requiring no extra modules.
Services: /common for authentication (login returns uid), /object for model
operations (execute_kw for read/search/create/write/unlink), /db for database
management.
Authentication: Session-based via db, username, password → returns user ID;
use this ID in subsequent calls with context.
Example Call (Python): Use xmlrpclib to hit /object/execute_kw with params like
model='[Link]', method='search_read', args=[domain], kw={'fields':
['name']}. Supports batching via multi-calls.
Limitations: Verbose XML format, less modern than REST/JSON.
RESTful API (Module-Based)
Install community modules like "Odoo RESTful API" or "rest_api_odoo" (from
Odoo Apps) to expose clean REST endpoints using JSON over HTTP. These
wrap Odoo's internal JSON-RPC for easier integration.
Endpoints: /restapi/{model} for GET (list/read), POST (create), PUT/PATCH
(update), DELETE (unlink); plus /restapi/auth for JWT tokens. Base URL
example: [Link]
Authentication: API Keys (generated per user in Settings > Users > API tab)
or JWT Bearer tokens; pass in Authorization: Bearer <token> header. No db/login
repetition after initial auth.
Key Features:
CRUD: GET /model?fields=name,id&domain=[('state','=','done')] returns paginated
JSON; POST /model with {"name": "Test", "partner_id": 7} creates records.
Relational Fields: Handles Many2one/many2many via IDs or search tuples
(e.g., [(4, [partner_id])]).
Binary/File Upload: Base64 encoding in JSON body for attachments.
Custom Methods: Call model methods via /model/{id}/method_name with
args/kwargs.
Configuration: Add server_wide_modules = rest_api_odoo to [Link], enable
methods per model in the module's UI (e.g., allow GET/POST for
[Link]).
Usage Best Practices
Security: Use HTTPS, API keys over passwords, limit permissions via Odoo
groups, rate limiting via nginx proxy.
Tools: Postman/Insomnia for testing; Python requests or OdooRPC lib for apps.
Libraries like odoo-jsonrpc simplify both protocols.
Error Handling: Responses include fault_code (e.g., 100 for auth fail)
and fault_string. Supports context/lang passing for i18n.
Performance: REST modules add ~5-10% overhead; use search_read over
read for efficiency; batch via multi in XML-RPC.
This makes Odoo highly integrable with systems like UMH (MQTT-to-REST
bridges) or [Link] (custom actions)
Prerequisites
Ensure you have Odoo installed (v16+ recommended), admin access, and
download a popular REST API module like "Odoo rest API" (free/community)
from Odoo Apps Store (e.g., ID 110 or 109).
Step 1: Download and Place Module
Download the module ZIP from Odoo Apps (search "rest_api_odoo" or
"odoo_restful").
Extract to your custom addons path (e.g., /odoo/custom_addons/ or Windows
equivalent).
Example: unzip rest_api_odoo.zip -d /path/to/odoo/custom_addons/.
Step 2: Update Odoo Config
Edit [Link] (or [Link]): Add server_wide_modules =
web,base,rest_api_odoo (replace with exact module name like odoo_rest).
Restart Odoo service: sudo systemctl restart odoo or ./odoo-bin -u all -d your_db.
Step 3: Install Module in Odoo
Login as admin, enable Developer Mode (Settings > Activate the developer
mode).
Go to Apps > Update Apps List (search bar icon).
Search "rest api" > Find your module (e.g., "Odoo rest API") > Click Install.
Wait for dependencies.
Step 4: Configure API Access
New menu appears: REST API > Configuration > REST Resources.
Create a new record: Select Model (e.g., [Link]), enable methods (GET,
POST, PUT, DELETE), set Name/Description.
In Settings > Users > Users, generate API Key for a user (new field post-
install).
Step 5: Test with Postman/Curl
Import module-provided Postman collection (often in ZIP).
Base URL: [Link] or /restapi/ (check module
docs).
Auth (API Key): Headers: db: your_db , api-key: generated_key, login:
username, password: pwd (first login).
GET: /[Link]?fields=name,id
POST: /[Link] body {"name": "Test Partner"}
Example Curl: curl -X GET "[Link] -H "api-key:
yourkey" -H "Content-Type: application/json" .
Step 6: Secure and Deploy
Enable HTTPS via nginx reverse proxy.
Limit methods per model/IP in config. Test JWT mode if available (some
modules support Bearer tokens).
Monitor logs: /var/log/odoo/[Link] for errors.
Troubleshooting
"Module not found": Wrong addons path in [Link] (addons_path).
404 Errors: Confirm server_wide_modules, restart.
Auth Fail: Regenerate API key, check user perms.
Overview
Integrating Odoo's REST API with React involves setting up authenticated API
calls from your React app to fetch/create/update Odoo data (e.g., products,
customers). Use a REST module (as previously set up), then handle CORS, auth,
and data fetching with fetch or Axios.
Prerequisites
Odoo REST API module installed/configured (e.g., endpoints
like /restapi/[Link]).
React app created (npx create-react-app odoo-react-app ).
API Key generated in Odoo (user settings).
Step 1: Handle CORS in Odoo
In Odoo REST module config or nginx proxy: Add cors="*" to routes (or specific
domain).
Example controller route: @[Link]('/api/products', auth='public', type='http',
methods=['GET'], csrf=False, cors="*") .
Step 2: Set Up React Environment
Create .env:
text
REACT_APP_ODOO_URL=[Link]
odoo:8069REACT_APP_ODOO_DB=your_databaseREACT_APP_API_
KEY=your_generated_key
Install Axios: npm i axios.
Step 3: Create API Service (api/[Link])
javascript
const ODOO_URL = [Link].REACT_APP_ODOO_URL;const DB =
[Link].REACT_APP_ODOO_DB;const API_KEY =
[Link].REACT_APP_API_KEY;export const fetchProducts =
async () => { try { const response = await
fetch(`${ODOO_URL}/restapi/[Link]?fields=name,list_price
`, { headers: { 'Content-Type': 'application/json', 'db':
DB, 'api-key': API_KEY } }); if (![Link]) throw
new Error('Fetch failed'); const result = await [Link]();
return [Link]; // Assumes module wraps as {status: 'success',
data: [...]} } catch (error) { [Link]('Odoo API error:', error);
throw error; }};export const createProduct = async (productData)
=> { const response = await
fetch(`${ODOO_URL}/restapi/[Link]`, { method: 'POST',
headers: { 'Content-Type': 'application/json', 'db': DB, 'api-key':
API_KEY }, body: [Link](productData) }); return
[Link]();};
Adapt headers/endpoints to your module (e.g., Bearer JWT).
Step 4: Build React Component
javascript
// components/[Link] React, { useState, useEffect }
from 'react';import { fetchProducts } from '../api/odoo';const
ProductList = () => { const [products, setProducts] = useState([]);
const [loading, setLoading] = useState(true); useEffect(() =>
{ fetchProducts() .then(data =>
setProducts(data)) .catch(err => [Link](err)) .finally(()
=> setLoading(false)); }, []); if (loading) return <div>Loading from
Odoo...</div>; return ( <ul> {[Link](product =>
( <li key={[Link]}>{[Link]} -
${product.list_price}</li> ))} </ul> );};export default
ProductList;
Use in [Link]: <ProductList />.
Step 5: Auth for Private Data
For session-based: First POST to /web/session/authenticate with credentials to get
session_id cookie, then credentials: 'include' in fetch.
API Key/JWT preferred for stateless apps.
Step 6: Run and Test
npm start → Open localhost:3000. Check browser console/network tab for API
calls. Handle errors with try/catch and loading states.
Advanced Tips
Pagination: Add ?limit=20&page=1 to queries.
Relations: Parse nested fields (e.g., partner_id → name).
Security: Proxy API calls server-side in production; use HTTPS.
Libs: odoo-react or axios interceptors for auth refresh