Appearance
AI in Odoo 19 Enterprise
Odoo 19 introduces a revolutionary AI framework that transforms the ERP into an intelligent, LLM-powered platform. This is the most significant AI integration in Odoo's history, providing native AI features across all major applications.
What's New in Odoo 19 AI
Odoo 19 moves beyond simple IAP-based OCR to a comprehensive AI agent system with:
- Native LLM Integration: Direct support for OpenAI (GPT-3.5 through GPT-5) and Google (Gemini 1.5/2.5)
- Vector Database & Semantic Search: PostgreSQL pgvector for RAG (Retrieval-Augmented Generation)
- AI Agents: Configurable assistants with custom knowledge sources and tool access
- AI-Computed Fields: Fields that auto-populate using AI inference
- AI in Automation: Server actions and workflows powered by LLM intelligence
- Cross-Module Integration: AI assistance in CRM, Documents, Knowledge, Livechat, Website, and Accounting
System Requirements
Critical Requirements for AI Features
- PostgreSQL with pgvector extension: Required for vector similarity search (embeddings). The module auto-checks and enables this at installation.
- API Keys: OpenAI API key OR Google AI API key with sufficient quota
- Internet Access: For API calls to LLM providers (no offline mode)
- Disk Space: Embeddings consume ~6KB per 1000-token chunk (1536 dimensions × 4 bytes)
Supported LLM Providers
| Provider | LLM Models | Embedding Model | Best For |
|---|---|---|---|
| OpenAI | GPT-3.5 Turbo, GPT-4, GPT-4o, GPT-4.1, GPT-4.1 Mini, GPT-5, GPT-5 Mini | text-embedding-3-small (1536 dim) | Most features, best tool support |
| Gemini 2.5 Pro, Gemini 2.5 Flash, Gemini 1.5 Pro, Gemini 1.5 Flash | gemini-embedding-001 | Alternative provider, competitive pricing |
API Key Configuration
Path: Settings → General Settings → AI section
- OpenAI API key: Get from
platform.openai.com - Google AI API key: Get from
makersuite.google.comAlternative: Environment variablesODOO_AI_CHATGPT_TOKENorODOO_AI_GEMINI_TOKEN
AI Agents - The Core of Odoo AI
What is an AI Agent?
An AI Agent is a configurable AI assistant with its own personality, knowledge base, and capabilities. Each agent can:
- Answer questions using its knowledge sources (RAG)
- Execute actions via assigned tools (server actions)
- Chat with users through the Discuss interface
- Handle customer queries in Livechat
- Generate content for emails, documents, and more
Agent Configuration Fields
| Field | Purpose | Options |
|---|---|---|
| Name | Display name for the agent | Free text (e.g., "Support Assistant") |
| LLM Model | Which AI model to use | GPT-4o (default), Gemini 2.5 Flash, etc. |
| Response Style | Controls AI "temperature" (creativity) | Analytical (0.2), Balanced (0.5), Creative (0.8) |
| System Prompt | Custom instructions for agent behavior | Free text - tells AI how to behave |
| Topics | Groups of instructions + tools | Natural Language Search, Information Retrieval |
| Restrict to Sources | Only answer from knowledge base | Boolean - prevents hallucination |
Example: Creating a Support Agent
Scenario: Create an AI agent to answer product support questions.
- Go to AI → Agents → Create
- Name: "Product Support Bot"
- LLM Model: GPT-4o (best for complex queries)
- Response Style: Analytical (factual answers)
- System Prompt: "You are a helpful product support assistant. Answer questions about our products accurately. If you don't know, say so."
- Enable Restrict to Sources
- Upload product manuals to Sources tab
Technical: Agent Model Structure
Model: ai.agent | File: Enterprise/ai/models/ai_agent.py
python
class AIAgent(models.Model):
_name = 'ai.agent'
name = fields.Char(related='partner_id.name')
llm_model = fields.Selection(default='gpt-4o')
response_style = fields.Selection([
('analytical', "Analytical"), # temperature: 0.2
('balanced', "Balanced"), # temperature: 0.5
('creative', "Creative"), # temperature: 0.8
])
system_prompt = fields.Text()
topic_ids = fields.Many2many('ai.topic')
sources_ids = fields.One2many('ai.agent.source')
restrict_to_sources = fields.Boolean()The "Ask AI" Button (Natural Language Search)
How Ask AI Works
The Ask AI feature lets users search Odoo data using natural language:
- User types: "Show me all sales orders over $10,000 this month"
- AI parses: Identifies model (sale.order), filters (amount_total > 10000), date range
- AI builds domain:
[('amount_total', '>', 10000), ('date_order', '>=', '2024-12-01')] - AI opens view: Navigates to filtered list view automatically Available from: Command palette (Ctrl+K) → "Ask AI"
RAG Sources - Building Knowledge Bases
What is RAG?
RAG (Retrieval-Augmented Generation) allows AI agents to answer questions based on your specific documents rather than general knowledge. This prevents hallucination and ensures accurate, context-specific responses.
Source Types
| Type | Supported Formats | Use Case |
|---|---|---|
| Binary (File) | PDF, DOC, TXT, HTML, images | Product manuals, policies, contracts |
| URL | Web pages (auto-scraped) | Knowledge base articles, documentation sites |
| Document | Odoo Documents app files | Internal documents already in Odoo |
| Knowledge Article | Odoo Knowledge app articles | Wiki content, procedures |
How Indexing Works
mermaid
graph LR
A[Upload File] --> B[Chunking]
B --> C[Embedding]
C --> D[Vector Search]
D --> E[Retrieve Chunks]
E --> F[AI Response]Source Status Lifecycle
| Status | Meaning | Action Required |
|---|---|---|
| Processing | Being chunked and embedded | Wait for cron job to complete |
| Indexed | Ready for use in RAG queries | None - source is active |
| Failed | Error during processing | Check error details, retry |
Technical: Vector Embedding Architecture
Model: ai.embedding | Uses PostgreSQL pgvector extension
python
# Vector field definition (1536 dimensions for OpenAI)
embedding_vector = Vector(size=1536)
# IVFFlat index for fast similarity search
_embedding_vector_idx = models.Index(
"USING ivfflat (embedding_vector vector_cosine_ops)"
)
# SQL for similarity search (cosine distance)
"""
SELECT id, 1 - (embedding_vector <=> %s::vector) AS similarity
FROM ai_embedding
ORDER BY similarity DESC
LIMIT 5
"""AI Fields - Auto-Fill with AI
What are AI Fields?
AI Fields are model fields that compute their values using AI. Instead of writing Python code or relying on user input, the field value is generated by an LLM based on a prompt template.
Supported Field Types
| Field Type | Auto-Update | Example Use Case |
|---|---|---|
| Char, Text, HTML | Yes (on save) | Product descriptions, summaries |
| Selection | Manual trigger | Priority classification, categories |
| Many2one | Manual trigger | Auto-assign salesperson, category |
| Many2many (Tags) | Manual trigger | Auto-tagging based on content |
| Integer, Float, Monetary | Manual trigger | Scoring, estimated values |
| Date, Datetime | Manual trigger | Suggested deadlines |
| Boolean | Manual trigger | Yes/No classification |
Field Reference Syntax
Use {{field_name}} to reference other fields in your prompt:
{{name}}- Current record's name{{partner_id.name}}- Related partner's name{{order_line.product_id.name}}- Products in order lines
Example: AI Product Description
Scenario: Auto-generate marketing descriptions for products. Field: marketing_description (Text, AI-computed) Prompt:
text
Write a compelling product description for "{{name}}".
Key features: {{description_sale}}
Category: {{categ_id.name}}
Keep it under 100 words, professional tone.Result: AI generates unique descriptions based on each product's attributes.
Technical: Creating AI Fields in Code
python
class ProductTemplate(models.Model):
_inherit = 'product.template'
# AI field with prompt in field definition
ai_description = fields.Text(
string="AI Description",
ai="""Write a marketing description for {{name}}.
Features: {{description_sale}}
Category: {{categ_id.name}}"""
)Cron Job: ai_fields.ir_cron_fill_ai_fields processes empty AI fields in batches.
AI Server Actions - Intelligent Automation
The "AI" Action Type
Odoo 19 adds a new server action type: "AI". This action uses an LLM to intelligently execute operations based on context.
AI Tool Execution Flow
- Trigger: Automation rule fires (on create, update, scheduled, etc.)
- Context: AI receives record data, available tools, and prompt
- Decision: LLM decides which tool(s) to call based on instructions
- Execution: Tool runs with AI-provided parameters
- Loop: Can call multiple tools in sequence until
__end_message
Action Types That Can Be AI Tools
| Action Type | What AI Can Do |
|---|---|
| Execute Code | Run Python code with AI-provided parameters |
| Create Activity | Schedule activities with AI-determined details |
| Create Record | Create records with AI-populated values |
| Update Record | Modify fields based on AI analysis |
| Add Followers | Add relevant users as followers |
| Send Webhook | Trigger external APIs with AI parameters |
| Post Message | Post AI-generated messages to chatter |
Example: AI Lead Qualification
Scenario: Automatically qualify leads based on description and source.
- Create Server Action: Type = "AI"
- Prompt: "Analyze this lead and determine quality (hot/warm/cold). Consider: {{description}}, {{source_id.name}}, {{expected_revenue}}."
- Add tool: Update Record (priority field)
- Create Automation: Trigger on lead creation Result: New leads automatically get priority assigned by AI analysis.
AI Livechat - Automated Customer Service
AI Chatbot in Livechat
AI Agents can be assigned to Livechat channel rules, allowing them to handle customer queries 24/7 without human intervention.
Setting Up AI Livechat
- Go to Website → Configuration → Livechat Channels
- Select your channel, go to Rules tab
- Create or edit a rule
- In AI Agent field, select your agent
- Configure URL pattern and conditions Note: System agents (internal) cannot be assigned to livechat.
AI Livechat Features
| Feature | Description |
|---|---|
| RAG Responses | Answers from uploaded knowledge sources |
| Lead Generation | Creates CRM leads from chat (ai_crm module) |
| Human Escalation | Transfers to human operator when needed |
| Scripted Bot Fallback | Can forward to chatbot script |
Predictive Lead Scoring (PLS) - Statistical AI
Not LLM-Based AI
Predictive Lead Scoring uses Bayesian statistics (classical machine learning), not LLM/GPT technology. It's been in Odoo CRM (Community) for several versions and works differently from the new AI modules.
How It Differs from ChatGPT-Style AI
| Aspect | Predictive Lead Scoring (PLS) | LLM AI (Odoo 19 AI Modules) |
|---|---|---|
| What it is | Statistics-based prediction | Language understanding (like ChatGPT) |
| Learns from | YOUR historical won/lost leads only | Billions of internet documents + your prompts |
| What it outputs | A number: "37% chance to win" | Text: emails, summaries, classifications |
| Needs training data? | Yes - needs your past leads | No - works immediately with prompts |
| Data privacy | 100% local - nothing leaves your server | Sent to OpenAI/Google APIs |
| Cost | Free (included in Community) | Pay per API call (Enterprise only) |
| Best for | Prioritizing leads, forecasting revenue | Writing content, understanding text |
Two Probability Fields on Leads
- Probability (%): Can be manual OR automated - shows current win likelihood
- Automated Probability: Always calculated by PLS - the statistical prediction
If you manually change Probability, it detaches from automated updates. Reset by setting it equal to Automated Probability again.
AI Documents - Intelligent Filing
Automatic Document Sorting
AI can automatically sort uploaded documents into the correct folders, add appropriate tags, and trigger workflows based on content analysis.
Document Sorting Flow
- Document arrives: Upload, email, or scan
- AI analyzes: Reads content, identifies document type
- AI decides: Matches to folder based on configured prompts
- AI executes: Moves to folder, adds tags
- Workflow triggers: Downstream automations fire
Example: Invoice Auto-Filing
- Go to Documents → Configuration → Folders
- Select or create "Vendor Bills" folder
- Enable AI Auto-Sort
- Configure prompt:text
Analyze this document. If it's a vendor invoice or bill: - Move to folder: [Vendor Bills folder ID] - Add tags: "invoice", vendor name If it's not a vendor invoice, do nothing. - Enable tools:
move_to_folder,add_tags
Other AI Features
AI Website Page Generation
Module: ai_website Generate website page content with AI:
- Multi-tone support: Concise, Professional, Friendly, Persuasive, Informative
- Multi-language: Generates in website's default language
- Placeholder replacement: AI fills template snippets with relevant content How to use: Website → Create Page → Check "Generate with AI" → Enter instructions
AI Knowledge Article Drafting
Module: ai_knowledge Draft Knowledge articles with AI assistance:
- Click AI button in article editor
- Describe what you want to write
- AI generates structured article content
- Articles can also be used as RAG sources
VoIP Call Transcription
Module: voip_ai Automatic call transcription and summarization:
- Transcription: Uses OpenAI Whisper API for audio → text
- Summary: AI generates one-liner summaries (max 60 chars)
- Status tracking: pending → queued → done/error Configuration: VoIP Provider → Transcription Policy = "Force for all users"
Web Studio AI Fields
Module: web_studio_ai_fields Create AI-computed fields directly in Web Studio:
- No coding required
- Supports all 11 field types
- Configure prompts with
/fieldsyntax - Visual prompt editor with placeholder insertion How to use: Studio → Add Field → Select "AI Field" → Configure prompt
Practical AI Use Cases - Try These!
Use Case 1: Smart Lead Qualification
Goal: Automatically score and prioritize incoming leads Setup Steps:
- Create AI Field on
crm.lead: "AI Priority Score" (Selection: Hot/Warm/Cold) - Prompt:text
Analyze this lead. Company: {{partner_name}}, Revenue: {{expected_revenue}}, Source: {{source_id.name}}, Description: {{description}}. Rate as hot (ready to buy), warm (interested), or cold (just browsing). - Create automation to notify sales team when AI marks lead as "Hot" Result: Sales team focuses on high-value leads first, improving conversion rates.
Use Case 2: Product Description Generator
Goal: Auto-generate SEO-friendly product descriptions Setup Steps:
- Create AI Field on
product.template: "Marketing Description" (HTML) - Prompt:text
Write a compelling product description for "{{name}}". Category: {{categ_id.name}}. Features: {{description_sale}}. Price: {{list_price}}. Include benefits, use cases, and a call-to-action. Format with bullet points. - Use on website product pages via Website Builder Result: Consistent, professional product descriptions without manual writing.
Use Case 3: Customer FAQ Chatbot
Goal: 24/7 customer support using your knowledge base Setup Steps:
- Create AI Agent: "Customer Support Bot"
- Upload FAQ documents, product manuals as RAG sources
- Enable "Restrict to Sources" to prevent hallucination
- Assign agent to Livechat channel rule for website visitors
- Configure human escalation for complex queries Result: Instant answers to common questions, human agents handle complex cases only.
Configuration & Best Practices
API Key Setup
- OpenAI (Recommended):
platform.openai.com→ API Key. Best for most features and GPT-4 model support. - Google Gemini:
makersuite.google.com→ API Key. Good alternative, competitive pricing.
Cost Considerations
- Embedding calls: Cheap (~$0.02/1M tokens)
- LLM calls: Varies ($2-20/1M tokens). GPT-4o is more expensive than GPT-4o-mini.
- Whisper transcription: $0.006/min. Recommendation: Use GPT-4o-mini or Gemini Flash for high-volume tasks, GPT-4o for complex reasoning. Set spending limits.
Security Considerations
- Data Usage: Prompts and context are sent to the AI provider.
- Access Rights: AI respects Odoo access rights. It only "sees" what the user has permission to see.
- Secrets: Keep API keys secure. Use environment variables.
Complete AI Module Reference
| Module | Feature | Auto-Install | Dependencies |
|---|---|---|---|
ai | Core AI framework | No | |
ai_app | Agent management UI | No | ai, attachment_indexation |
ai_fields | AI-computed fields | Yes | ai |
ai_server_actions | AI in automations | Yes | ai_fields |
ai_livechat | AI chatbot | Yes | ai, im_livechat |
ai_documents | Document sorting | Yes | ai, documents |
ai_documents_source | Documents as RAG sources | Yes | ai, documents |
ai_crm | Lead generation | Yes | ai, crm |
ai_website | Website content generation | Yes | ai, website |
ai_knowledge | Article drafting | Yes | ai, knowledge |
voip_ai | Call transcription | Yes | ai, voip |
hr_recruitment_ai | Rejection emails | Yes | ai, hr_recruitment |
sign_ai | Signature request emails | Yes | ai, sign |
ai_account | Invoice emails | Yes | ai, account |
web_studio_ai_fields | Studio AI field creation | Yes | ai_fields, web_studio |