| Availability |
Odoo Online
Odoo.sh
On Premise
|
| Odoo Apps Dependencies |
Discuss (mail)
|
| Community Apps Dependencies | Show |
| Lines of code | 3809 |
| Technical Name |
foundation |
| License | OPL-1 |
| Website | https://praetorx.net |
| Availability |
Odoo Online
Odoo.sh
On Premise
|
| Odoo Apps Dependencies |
Discuss (mail)
|
| Community Apps Dependencies | Show |
| Lines of code | 3809 |
| Technical Name |
foundation |
| License | OPL-1 |
| Website | https://praetorx.net |
Foundation
AI Provider Hub — OpenAI, Claude, Azure with Encryption & Health Monitoring for Odoo 19
Central AI provider management for Odoo. Configure OpenAI, Anthropic Claude, Azure, or local models in one place. Encrypted API keys, health monitoring, rate limiting, cost tracking, GDPR compliance flags, and automatic fallback — used by Invoice Pro, Vault, and other PraetorX modules.
praetorx.net | Syntax & Sabotage
AI Provider Management
OpenAI (GPT-4o, GPT-4o Mini), Anthropic (Claude Sonnet, Opus, Haiku), Azure OpenAI, and local models (Ollama, Llama, Mistral). 12 pre-configured model options.
API keys are encrypted at rest using Fernet + PBKDF2 (via Python cryptography). Keys are never stored in plain text. Only system administrators can view key fields.
Per-provider health status (healthy / degraded / unhealthy), connection testing, response time tracking, and last-error logging. One-click health check button.
Designate a default provider and a fallback. get_best_provider() selects by capabilities, health, and GDPR requirements. Automatic failover when the primary is down.
Per-provider rate limits (req/min), daily quotas, and usage counters. Cost per 1K tokens and total cost tracking. Usage resets automatically.
Data region selection (US / EU / Local), zero-retention confirmation toggle. GDPR compliance auto-computed from region + retention settings. get_gdpr_compliant_provider() shortcut.
Developer Patterns
Inherit foundation.ai.provider.mixin in your model to add an ai_provider_id field and _get_ai_service() method. One line to connect any model to AI.
Inherit foundation.failure.activity.mixin to surface errors as mail.activity records. Auto-deduplication: identical failures don’t create duplicate activities. _resolve_failure_activity() clears on success.
Inherit foundation.wizard.base for multi-step wizards with progress indicators, step validation hooks, back/next navigation, and Foundation-branded SCSS styling (light + dark mode).
Per-provider capability flags: OCR, vision, structured output, function calling. Auto-set when selecting a model. get_best_provider() filters by required capabilities.
Technical Reference
| Component | Details |
|---|---|
| foundation.ai.provider | 47 fields — provider config, auth (encrypted), model params, capabilities (4), rate limits, cost tracking, health monitoring, GDPR compliance, statistics. 24 methods. |
| foundation.ai.provider.mixin | Abstract — adds ai_provider_id M2O + _get_ai_service() to any model. |
| foundation.failure.activity.mixin | Abstract — _create_failure_activity() with deduplication, _resolve_failure_activity() for auto-resolution. Works on any mail.thread model. |
| foundation.wizard.base | Abstract — multi-step wizard with progress, navigation, validation hooks, completion logic. 2-step and 3-step QWeb templates included. |
| Encryption | Fernet + PBKDF2 via Python cryptography. Keys encrypted on create/write, decrypted only when used. |
| Demo Data | 3 inactive provider records (OpenAI GPT-4o Mini, Anthropic Claude Sonnet, Local Ollama) for quick setup. |
Use Cases
Invoice Pro uses Foundation to route OCR requests to the best available vision-capable provider. If OpenAI is down, it falls back to Claude automatically.
Vault uses Foundation to classify incoming documents. GDPR mode ensures EU documents are processed by EU-region or local providers only.
Run Ollama locally and configure it as a Foundation provider. No API keys needed, no data leaves your network. Full air-gap support.
Track cost per 1K tokens and total spend per provider. Set daily quotas to prevent runaway API costs. Usage counters reset automatically.
Screenshots
AI Provider Dashboard
All configured providers at a glance — type, model, data region, connection status, health, request counts, success rate, and fallback chain.
Capability Auto-Detection
Capabilities are automatically detected from the selected model — OCR processing, vision analysis, structured output, and function calling. Manual override available.
Provider Configuration
Each provider has its own authentication and model parameter settings — API key, endpoint, temperature, top-p, and token limits.
GDPR Compliance
Data residency and compliance tab per provider — configure EU region, data retention, and get step-by-step setup instructions for compliant deployments.
Setup Guide
- Odoo 19.0 (Community or Enterprise)
- Python 3.10+
- Python packages:
pip install cryptography requests - Odoo modules:
base,mail
No Enterprise dependency. Works on Community, Enterprise, and Odoo.sh.
- Install Python packages:
pip install cryptography requests - Install from the Odoo Apps menu — search for “Foundation”
Foundation is typically installed automatically as a dependency of Invoice Pro, Vault, or other PraetorX AI modules.
- Navigate to Foundation → Configuration → AI Providers
- Click New or activate one of the 3 demo providers (OpenAI, Claude, Ollama)
- Enter your API key — it will be encrypted automatically
- Select the model and adjust parameters (temperature, max tokens, timeout)
- Click Test Connection to verify
- Mark as Default (and optionally set a fallback provider)
Navigate to Settings → Foundation:
- AI Features: Global enable/disable toggle
- Default AI Provider: Select from configured providers
- Automatic Fallback: Enable and select a fallback provider
Add foundation to your module’s depends, then inherit:
class MyModel(models.Model):
_name = "my.model"
_inherit = ["mail.thread", "foundation.ai.provider.mixin",
"foundation.failure.activity.mixin"]
Call self._get_ai_service() to get the provider for AI requests. Call self._create_failure_activity(summary) on errors.
FAQ
base and mail only. Works on Community, Enterprise, and Odoo.sh.cryptography library). Keys are encrypted on create and write, decrypted only when needed for API calls. The key field is restricted to base.group_system.http://localhost:11434 for Ollama). No API key required. Local providers are automatically flagged as GDPR-compliant.get_best_provider() method checks health status and capability requirements before selecting. Failed requests are logged with error details.cryptography (for API key encryption) and requests (for HTTP calls to local providers). Both are widely used, stable Python packages. Install via pip install cryptography requests.Release History
v19.0.1.4.0 — March 2026
Current Release
- Failure Activity Mixin —
_create_failure_activity()with deduplication,_resolve_failure_activity()auto-resolution - 16 automated tests for failure activity mixin
v19.0.1.0.0 — Initial Release
Initial Release
- AI Provider Hub — OpenAI, Anthropic Claude, Azure, Local (Ollama)
- Encrypted API keys (Fernet + PBKDF2)
- Health monitoring, connection testing, response time tracking
- Default + fallback provider selection with capability matching
- Rate limiting, daily quotas, cost tracking
- GDPR compliance flags (data region, zero retention)
- AI Provider Mixin for consuming modules
- Multi-step Wizard Framework (2-step and 3-step templates)
- 3 demo providers (inactive)
- German and French translations (de.po, fr.po)
Modules That Depend on Foundation
Enterprise-grade bidirectional sync between Odoo Documents and SharePoint Online.
99 EURMade with ♥ by Syntax & Sabotage
© 2026 Syntax & Sabotage, Lars Weiler. All rights reserved. OPL-1.
Impressum · support@syntaxandsabotage.io
Odoo Proprietary License v1.0 This software and associated files (the "Software") may only be used (executed, modified, executed after modifications) if you have purchased a valid license from the authors, typically via Odoo Apps, or if you have received a written agreement from the authors of the Software (see the COPYRIGHT file). You may develop Odoo modules that use the Software as a library (typically by depending on it, importing it and using its resources), but without copying any source code or material from the Software. You may distribute those modules under the license of your choice, provided that this license is compatible with the terms of the Odoo Proprietary License (For example: LGPL, MIT, or proprietary licenses similar to this one). It is forbidden to publish, distribute, sublicense, or sell copies of the Software or modified copies of the Software. The above copyright notice and this permission notice must be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
Please log in to comment on this module
Solid backbone for anything AI in Odoo.
What stands out: it actually takes security seriously. No plain text nonsense, no “hope this is fine”. And the config lives where it should — in settings, not scattered across modules.
It’s not flashy. You don’t “see” it much. But once it’s there, everything AI-related just feels… structured.
There are no comments yet!