feat: odoo direct integration#218
Draft
esafwan wants to merge 8 commits into
Draft
Conversation
10-phase implementation plan for making HUF the #1 AI automation system for Odoo ERP. Covers: - Phase 1: Odoo Connection DocType (credential management) - Phase 2: RPC Connector Core (XML-RPC, JSON-RPC, JSON-2) - Phase 3: Odoo-specific Agent Tool Functions (10 tools) - Phase 4: Schema Discovery & Cache (via fields_get/ir.model) - Phase 5: Webhook Receiver (inbound events from base.automation) - Phase 6: Polling Trigger Service (adaptive write_date polling) - Phase 7: Pre-built Odoo Agents (CRM, Sales, Invoice, etc.) - Phase 8: JSON-2 API Support (Odoo 19+ future-proofing) - Phase 9: Frontend Connection Wizard - Phase 10: Documentation & Guides Based on deep research analysis of Odoo's API landscape, authentication models, hosting constraints, and deprecation timeline. 21 new files, 5 modified files planned across all phases.
… compound engineering documentation
- Implemented missing tool handlers (search_count, read_group) - Refactored RateLimiter to use shared connection-scoped cache - Converted polling sync to async enqueuing for better performance - Optimized Schema Discovery with O(1) indexing and abstract model handling - Secured Webhook keys using Password fields and connection routing - Added Agent-level odoo_connection for auto-injection into tool calls - Updated AGENTS.md and SKILL details to reflect architectural refinements
Python dict duplicate keys silently overwrite — the second "cron" key was replacing the first, causing odoo polling to never run. https://claude.ai/code/session_01Uk76A2xXqimHUAaE3nBPeP
…limitation Odoo has NO native webhook system. The current integration uses polling (every 5 min via write_date) and an inbound webhook receiver that requires manual base.automation setup on the Odoo side. This document designs a thin companion Odoo module (huf_connector) that: - Patches ORM create/write/unlink via _register_hook() on selected models - Pushes events to HUF in real-time without manual per-model setup - Covers ALL Odoo modules (CRM, Sales, Inventory, HR, etc.) generically - Includes a setup wizard for one-click configuration - Supports batched event flushing to avoid flooding HUF Polling remains necessary as fallback for Odoo SaaS Standard customers who cannot install custom modules. https://claude.ai/code/session_01Uk76A2xXqimHUAaE3nBPeP
…ib eval - Odoo 18+ has native "Send Webhook Notification" automation actions - Odoo 17 has inbound "External trigger" but no outbound webhooks - Odoo 15-16 has no webhook support at all - Added decision matrix: companion module vs native webhooks vs polling - Added evaluation of odoo-client-lib as transport layer replacement - Not currently using odoo-client-lib; recommend evaluating for Phase 2 https://claude.ai/code/session_01Uk76A2xXqimHUAaE3nBPeP
- Drop Odoo 15-16 from support scope, 17+ only going forward - Replace vague odoo-client-lib recommendation with exact migration steps: 7 steps, 6 files touched, zero caller changes needed - Update decision matrix and version tables for 17+ scope - Companion module manifest updated for multi-version branching https://claude.ai/code/session_01Uk76A2xXqimHUAaE3nBPeP
- Replaced hand-rolled RPC protocols with odoo-client-lib - Simplified OdooConnector and improved protocol auto-detection - Removed legacy protocols/ directory and internal RPC exceptions - Updated test_connection() to use unified transport path - Added odoo-client-lib to pyproject.toml
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
First-Class Odoo ERP Integration for HUF
This PR implements native Odoo ERP integration into HUF, enabling AI agents to interact with Odoo instances via a protocol-agnostic RPC engine, respond to business events in real-time, and query/mutate data across all Odoo modules.
Scope: Odoo 17+ only | New code: ~880 lines across 13 files | Breaking changes: None
Why This Matters
Odoo is the most widely deployed open-source ERP. Until now, connecting HUF agents to Odoo required custom tool functions per customer. This integration makes Odoo a first-class citizen — any HUF agent can search, create, update, delete, and execute methods on any Odoo model out of the box.
Architecture
Five tightly integrated subsystems:
Event flow (Odoo → HUF):
What's Included
1. Odoo Connection DocType
Stores credentials, protocol, version, and connection state. Key fields:
Backward Compatibility
odoo_connectionfield on Agent DocType is hidden unless Odoo tools are present.Test Plan
bench --site <site> migrateapplies cleanlypolling.run_polling_sync(/5) andorchestration.scheduler.process_orchestrations(/1)