Odoo 17, 18 & 19 AI Ontology & Governed MCP Server
Odoo’s PostgreSQL database looks clean until an AI agent hits ir_property / JSONB company-dependent fields, translated JSONB columns, x_studio customizations and non-stored computed fields that exist only in Python ORM methods. Direct SQL misses ORM business logic, while raw admin RPC bypasses per-user ir.rule access boundaries. Naditu combines fast replica reads with ORM-accurate semantics and caller permissions.
PostgreSQL Read Replica · Odoo JSON-2 / XML-RPC
Human-approved via Odoo ORM RPC methods
Canonical ontology mapping
Business objects & field-level governance.
Instead of exposing raw physical tables to an LLM, Naditu assembles governed domain objects and enforces caller role policies at query time.
Partner & Commercial Entity
Physical tables / entitiesres_partner · account_payment_term · res_companyGovernance & masking rulecompany_id isolation & credit limit visibility by roleSales Order & Invoice
Physical tables / entitiessale_order · sale_order_line · account_move · account_move_lineGovernance & masking rulepurchase_price & margin masked outside Sales Leads & FinanceStock Quant & Picking
Physical tables / entitiesstock_quant · stock_picking · stock_move · stock_locationGovernance & masking ruleInternal vs transit/scrap virtual location filtering enforcedManufacturing Order & BOM
Physical tables / entitiesmrp_production · mrp_workorder · mrp_bom · mrp_bom_lineGovernance & masking ruleWorkcenter cost rates restricted to Operations & Finance
| Business object | Physical tables / entities | Governance & masking rule |
|---|---|---|
| Partner & Commercial Entity | res_partner · account_payment_term · res_company | company_id isolation & credit limit visibility by role |
| Sales Order & Invoice | sale_order · sale_order_line · account_move · account_move_line | purchase_price & margin masked outside Sales Leads & Finance |
| Stock Quant & Picking | stock_quant · stock_picking · stock_move · stock_location | Internal vs transit/scrap virtual location filtering enforced |
| Manufacturing Order & BOM | mrp_production · mrp_workorder · mrp_bom · mrp_bom_line | Workcenter cost rates restricted to Operations & Finance |
Why raw SQL & generic MCP fail
Three physical schema traps solved in the layer.
Every operational system carries implicit join keys, status discriminators and multi-company rules that ungrounded Text-to-SQL guesses wrong.
- 01
Virtual stock locations (Customer, Vendor, Inventory Loss) in stock_quant
Odoo double-entry inventory tracks customer shipments and scrap as positive balances in virtual stock_location rows (usage != internal). Summing stock_quant without usage = internal wildly corrupts on-hand stock.
- 02
JSONB translated names and company-dependent properties
In Odoo 16+, translatable fields store locale JSONB maps (en_US, tr_TR) and company-specific accounts or prices sit in JSONB property maps. Naditu resolves the right locale and company_id cleanly.
- 03
Custom x_studio_ columns and non-stored ORM compute fields
Fields calculated in Python (@api.depends without store=True) do not exist as PostgreSQL columns. The ontology documents exact SQL derivations or routes lookups through scoped RPC.
Common engineering questions.
Does Naditu support Odoo Community and Enterprise across versions 17, 18 and 19?
Yes, including Odoo 19’s JSON-2 API as well as Odoo 17 and 18 XML-RPC/JSON-RPC and PostgreSQL read replicas, both self-hosted and Odoo.sh.
Why not point an off-the-shelf PostgreSQL MCP server directly at Odoo’s database?
Raw PostgreSQL MCP bypasses Odoo ir.rule multi-company security, sums virtual customer locations into warehouse stock, and risks corrupting accounting invariants if any write is attempted outside the ORM.
How are Odoo actions such as confirming a draft purchase order executed?
Writes execute strictly through Odoo ORM methods (such as button_confirm or create) behind a named human approval gate so chatter logs, taxes and stock moves fire properly.
Engineering deep dives
Related architecture notes from the blog.
Connecting Oracle NetSuite, Odoo 19, and IFS Cloud to AI
How industrial and multi-entity groups connect Oracle NetSuite, Odoo 19, and IFS Cloud to AI: SuiteQL caps, JSON-2 APIs, Aurena OData, and MCP.
Wren AI and Vanna AI Text-to-SQL alternative for ERP data
Comparing Wren AI (MDL + DataFusion) and Vanna AI (RAG DDL vectors) against an enterprise ontology for live multi-ERP queries, RBAC, and write gates.