OptimaAI Logo

Overview

Odoo ERP integration and data sources

Odoo Integration

OptimaAi reads business data from Odoo ERP (versions 16 and 17). Odoo is the source of truth for all ML training data and live prediction features.

Data Sources

The platform uses three categories of Odoo data:

DatasetOdoo ModulesPurpose
RevenueSales (sale.order, sale.order.line)Revenue forecasting model training
ChurnCRM + Sales (crm.lead, res.partner)Churn prediction model training
GrowthSales + Accounting (account.move)3-month growth projection model

Integration Approach

OptimaAi currently uses a CSV export workflow:

  1. An Odoo administrator exports the relevant data from Odoo's built-in export tool
  2. CSV files are placed in the data/ directory
  3. python ml/train.py reads and trains on the exported files
  4. The trained artefacts are picked up automatically by the API
Odoo → Export CSV → data/ folder → train.py → optimaai_artefacts/ → API

ℹ️ Note: A live Odoo API integration (via xmlrpc or the Odoo REST API) is planned for future versions. The current CSV pipeline is intentional — it decouples data freshness from model freshness, allowing controlled retraining schedules.

Planned: Live Odoo API Connection

For real-time data sync, the Odoo XML-RPC API can be used:

import xmlrpc.client
 
url     = "https://your-odoo.com"
db      = "your_db"
user    = "admin@company.com"
api_key = "your_odoo_api_key"
 
common = xmlrpc.client.ServerProxy(f"{url}/xmlrpc/2/common")
uid    = common.authenticate(db, user, api_key, {})
 
models = xmlrpc.client.ServerProxy(f"{url}/xmlrpc/2/object")
 
# Fetch confirmed sale orders
orders = models.execute_kw(
    db, uid, api_key,
    'sale.order', 'search_read',
    [[['state', '=', 'sale']]],
    {'fields': ['name', 'partner_id', 'amount_total', 'date_order'], 'limit': 1000}
)

Data Volume Requirements

For reliable ML model performance, minimum dataset sizes are recommended:

ModelMinimum RowsRecommended
Revenue Regressor500 orders5,000+
Churn Classifier300 customers2,000+
Growth Regressor12 months history24+ months
Prophet12 data points36+

⚠️ Warning: With fewer than the minimum rows, models will train but evaluation metrics may be unreliable. The quality_score in the preprocessing pipeline can help assess data sufficiency.

On this page