Self-Hosted Odoo AI Assistant: Private Architecture With a Local Model
self-hosted Odoo AI assistant without cloud
Also searched as
- how to add a local LLM to Odoo on-premise
- Odoo AI integration private server
- Odoo Community ChatGPT alternative on-prem
- Odoo external API AI agent read-only
Short answer
Self-hosted Odoo already exposes its data through an authenticated external API that enforces access rights and record rules, so a private assistant can call it as the signed-in user. Add a retrieval index over attachments and a local open-weight model, and nothing leaves your servers. Direct PostgreSQL access is for aggregates only, because it bypasses record rules.
Applies to: Odoo Community and Enterprise self-hosted on your own servers. Odoo.sh and Odoo Online are cloud-hosted and outside this pattern.
Reference build for a private AI layer on self-hosted Odoo
- 1Confirm the Odoo version and edition, the PostgreSQL version, whether you run multi-company, and where the filestore lives.
- 2Create a dedicated Odoo user group for the assistant's service identity and, for per-user answers, have each person issue themselves an API key from their account preferences so calls run as that person.
- 3Use the external API (XML-RPC or JSON-RPC, and the newer JSON API in recent versions) for read calls such as search_read on sale orders, stock quants, manufacturing orders and purchase orders. The ORM then applies access rights and record rules.
- 4For heavy analytics, add a PostgreSQL streaming replica and a read-only role exposing curated views. Use it only for aggregates the whole team may see.
- 5Index attachments: ir.attachment holds file metadata in the database and the files in the filestore. Tag chunks with res_model and res_id so retrieval can be scoped to records the user can open.
- 6Expose approved read actions through an MCP or REST tool server rather than raw model-built domains.
- 7Serve an open-weight model with vLLM or Ollama on a local GPU server and deny it outbound internet.
- 8Log every question, tool call, domain filter and result count; review it during the pilot.
Odoo's data model and API for read access
Odoo is a model-based ORM on PostgreSQL. Business objects are models such as res.partner, product.product, sale.order and sale.order.line, purchase.order, stock.quant and stock.move, mrp.production and mrp.bom, and account.move. The external API authenticates a user and then calls ORM methods like search_read with a domain and a list of fields.
Because the call runs through the ORM as that user, groups in ir.model.access and record rules in ir.rule apply, including multi-company restrictions through the allowed companies on the session. That is the cleanest way to make an assistant respect existing permissions.
Recent versions add a newer JSON API and plan to retire the older RPC endpoints, so check your version's documentation before building on one of them.
import xmlrpc.client
url, db = 'https://odoo.internal', 'prod'
common = xmlrpc.client.ServerProxy(url + '/xmlrpc/2/common')
uid = common.authenticate(db, 'user@example.com', 'USER_API_KEY', {})
models = xmlrpc.client.ServerProxy(url + '/xmlrpc/2/object')
rows = models.execute_kw(db, uid, 'USER_API_KEY', 'mrp.production', 'search_read',
[[['state', 'in', ['confirmed', 'progress']]]],
{'fields': ['name', 'product_id', 'product_qty', 'date_start'], 'limit': 20})Reference architecture and air-gapped option
Run the assistant services next to Odoo: a tool server that wraps API calls, a vector index for attachments and knowledge articles, the model server on a GPU host and an audit store. For aggregate analytics, a PostgreSQL replica with a read-only role keeps load off the production database.
Direct SQL is tempting but bypasses record rules and company limits, and Odoo's table names follow the model names with dots replaced by underscores. Use SQL only for data every permitted user may see, and never for per-user answers.
For an air-gapped deployment, the Odoo instance, replica, model and index all live in the enclave and model files are brought in on controlled media.
Permissions and write-back
The simplest correct design is to authenticate as the person asking. Each call then returns only what Odoo would show them, in their companies, under their groups. Avoid a single powerful service account that the assistant filters itself.
Attachment retrieval needs the same care: check read access on the parent record through the API before including a chunk in a prompt.
For write-back, use the API to create drafts such as a quotation or a purchase order in draft state and let the user confirm in Odoo. Keep the confirm step human.
Sizing, rollout and limits
Odoo sites range from a dozen to several hundred users. A single GPU serves most of them, and the main costs are attachment indexing and tuning tool descriptions for custom modules and Studio fields.
Phase 1: read-only questions on sales, stock, manufacturing and purchasing. Phase 2: drafts and summaries. Phase 3: approved actions such as creating draft records.
Limits: Odoo Enterprise includes AI features in recent versions, and if those meet your policy they may be enough; custom modules need their own tool definitions; and API pagination limits must be respected on large tables.
Try it here, free
Self-Hosted Odoo AI Assistant Sizing and Value Calculator
Estimate GPU count, token volume, index size, hours saved and payback for a private on-prem AI assistant on Self-Hosted Odoo.
Common pitfalls
- !Using direct PostgreSQL access for per-user answers, which bypasses record rules and company limits.
- !Sharing one admin API key across the assistant so every user sees everything.
- !Calling search_read without limits or field lists on very large tables.
- !Ignoring multi-company context, so answers mix entities.
- !Indexing attachments without checking read access on the parent record.
- !Building on a deprecated RPC endpoint without checking your version's roadmap.
How an ERP-grounded AI assistant handles this
ERPray can call Odoo's API as the signed-in user, for instance listing manufacturing orders blocked on components, with the domain filter shown. Netray sets up the tool server, attachment index and local model, and Odoo partners remain the experts on your custom modules.
Frequently asked questions
Can Odoo run a local LLM without any cloud?
Yes, if you self-host. The assistant calls Odoo's external API, retrieves attachments from a local index and uses an open-weight model on your own GPU. Nothing needs to leave your network, and the same design works air-gapped.
Why not just query PostgreSQL?
Direct SQL bypasses access rights and record rules, so it can show users data Odoo would hide. Use it only for aggregates all permitted users may see. For per-user answers call the API as that user.
Does it work with Odoo Community?
Yes. The external API is available in Community and Enterprise self-hosted. Some enterprise-only apps add models you may want to expose, and tool definitions should reflect the modules you actually run.
Is Odoo's built-in AI enough?
Possibly. If the built-in features satisfy your data policy and cover your questions, use them. A private layer helps when data must stay on site or you want one assistant across Odoo data and other document sources.
Related
Odoo External API: Authenticate and search_read with XML-RPC and JSON-RPC
Call the Odoo external API by authenticating against /xmlrpc/2/common to get a user id, then calling execute_kw on /xmlrpc/2/object with the database, uid, password or API key, model name, method and arguments. If authenticate returns False, the database name, login, or API key is wrong, or two-factor is enforced for that user.
Error fixFix Odoo AccessError: You Are Not Allowed to Access Records
Odoo raises AccessError when a user's security groups do not grant a CRUD right on a model through ir.model.access.csv, or when an ir.rule record rule filters the specific record out for that user or company. Fix it by adding the user to the group named in the error, editing the model's access rights, or reviewing the record rule's domain under Settings > Technical > Security.
AdvancedHow to Add AI to Macola ERP On-Prem Without Sending Data to a Cloud
Macola 10 runs on SQL Server, so the safest pattern is a read-only reporting copy of the Macola company database, a small set of approved views, a retrieval index over attached documents, and an open-weight model served on a local GPU. Writes stay out of the first phases and, when added, go through Macola's supported import or SDK routes with a person approving each one.
AdvancedMade2Manage AI Integration Without Cloud: A Private On-Prem Architecture
Made2Manage stores jobs, sales orders, purchasing and inventory in SQL Server tables that a reporting copy can expose through approved views. Pair that with a retrieval index over job travelers and quality documents and an open-weight model on a local GPU, and users can ask about jobs, shortages and orders without any data leaving the plant.
How-toHow to Create a Generic Inquiry in Acumatica
Generic Inquiries (GI) are Acumatica's no-code query builder for joining tables, adding filters, and exposing the result as an inquiry screen, dashboard data source, or API endpoint. Open System > Customization > Generic Inquiry, add your base table, define joins and conditions, then run and save. No SQL or customization project is required.
How-toHow to Void a Check in Sage 100
Sage 100 voids checks through Accounts Payable > Main > Check and Payment Voiding. Select the bank code, choose the check number, and Sage reverses the Cash Disbursements Journal entry and reopens the invoice it paid. A check that already cleared in Bank Reconciliation or falls in a closed period needs an extra step before it can be voided cleanly.
AI for ERPAI for Odoo Manufacturing That Reads Your Own Database, Not a Vendor's Cloud
Add grounded, natural-language AI to Odoo Manufacturing without sending MRP, BoM, or work order data to a public model. On-prem or private cloud, ORM-native.
AI for ERPAI for Odoo Manufacturing (MRP): BOMs, Work Orders and Shortages
AI for Odoo Manufacturing: BOM checks, work order delays, reordering rules and plain-language questions over mrp.production data, on-prem or private cloud.
AI for ERPAI Agents for ERP, Running On-Prem
A practical guide to on-prem AI agents for ERP: what they can safely automate, where human approval belongs, and how to design the guardrails.
Stuck on Odoo (self-hosted)?
Talk to engineers who work inside Odoo (self-hosted) every week, and who build private AI that answers these questions from your own ERP data.
Keep exploring
Free tools
- Self-Hosted Odoo AI Assistant Sizing and Value CalculatorEstimate GPU count, token volume, index size, hours saved and payback for a private on-prem AI assistant on Self-Hosted Odoo.
- Self-Hosted Odoo Private AI Layer Blueprint GeneratorGenerate a shareable architecture plan for adding a private, on-prem AI assistant to Self-Hosted Odoo, with components, security controls and a three-phase rollout.
- Odoo Manufacturing Technical Model Names ReferenceSearchable lookup of the Odoo models behind manufacturing, inventory, purchasing and sales, with the fields you query most.
ERP fixes and how-tos
- Odoo Manufacturing Reports: Production Analysis, Cost and ForecastBuilt-in Odoo manufacturing and production reports, how to forecast demand and component needs, and how to build custom MRP reports with SQL or Studio.
- Odoo Manufacturing API: Working with mrp.production and mrp.bomUse the Odoo external API (XML-RPC and JSON-RPC) with manufacturing models: read BOMs, create and confirm manufacturing orders, and handle states.
- Odoo External API: Authenticate and search_read with XML-RPC and JSON-RPCHow to call the Odoo external API with XML-RPC or JSON-RPC: authenticate, API keys, search_read, create and write, plus why authenticate returns False.
AI on your ERP
- AI for Odoo Manufacturing That Reads Your Own Database, Not a Vendor's CloudAdd grounded, natural-language AI to Odoo Manufacturing without sending MRP, BoM, or work order data to a public model. On-prem or private cloud, ORM-native.
- AI for Odoo Manufacturing (MRP): BOMs, Work Orders and ShortagesAI for Odoo Manufacturing: BOM checks, work order delays, reordering rules and plain-language questions over mrp.production data, on-prem or private cloud.
Integrations
- How to add AI agents to OdooHow to add AI agents to Odoo Manufacturing: a tool layer over the external API, approval before writes, and agents for MRP exceptions, POs and quality.
- How to connect ChatGPT to OdooHow to connect ChatGPT to Odoo: custom GPT actions, exports versus live access, enterprise data controls, and when a private model is the safer choice.
Software
- OdooWhat Odoo is, how its open-source Community and Enterprise editions differ, how the manufacturing apps and XML-RPC API work, and which alternatives to compare.
- ERPNextVendor-neutral guide to ERPNext, the open-source ERP from Frappe: manufacturing modules, REST API, hosting options, limits, alternatives and AI uses.