Skip to content

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

  1. PostgreSQL with pgvector extension: Required for vector similarity search (embeddings). The module auto-checks and enables this at installation.
  2. API Keys: OpenAI API key OR Google AI API key with sufficient quota
  3. Internet Access: For API calls to LLM providers (no offline mode)
  4. Disk Space: Embeddings consume ~6KB per 1000-token chunk (1536 dimensions × 4 bytes)

Supported LLM Providers

ProviderLLM ModelsEmbedding ModelBest For
OpenAIGPT-3.5 Turbo, GPT-4, GPT-4o, GPT-4.1, GPT-4.1 Mini, GPT-5, GPT-5 Minitext-embedding-3-small (1536 dim)Most features, best tool support
GoogleGemini 2.5 Pro, Gemini 2.5 Flash, Gemini 1.5 Pro, Gemini 1.5 Flashgemini-embedding-001Alternative 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 variables ODOO_AI_CHATGPT_TOKEN or ODOO_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

FieldPurposeOptions
NameDisplay name for the agentFree text (e.g., "Support Assistant")
LLM ModelWhich AI model to useGPT-4o (default), Gemini 2.5 Flash, etc.
Response StyleControls AI "temperature" (creativity)Analytical (0.2), Balanced (0.5), Creative (0.8)
System PromptCustom instructions for agent behaviorFree text - tells AI how to behave
TopicsGroups of instructions + toolsNatural Language Search, Information Retrieval
Restrict to SourcesOnly answer from knowledge baseBoolean - prevents hallucination

Example: Creating a Support Agent

Scenario: Create an AI agent to answer product support questions.

  1. Go to AI → Agents → Create
  2. Name: "Product Support Bot"
  3. LLM Model: GPT-4o (best for complex queries)
  4. Response Style: Analytical (factual answers)
  5. System Prompt: "You are a helpful product support assistant. Answer questions about our products accurately. If you don't know, say so."
  6. Enable Restrict to Sources
  7. 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()

How Ask AI Works

The Ask AI feature lets users search Odoo data using natural language:

  1. User types: "Show me all sales orders over $10,000 this month"
  2. AI parses: Identifies model (sale.order), filters (amount_total > 10000), date range
  3. AI builds domain: [('amount_total', '>', 10000), ('date_order', '>=', '2024-12-01')]
  4. 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

TypeSupported FormatsUse Case
Binary (File)PDF, DOC, TXT, HTML, imagesProduct manuals, policies, contracts
URLWeb pages (auto-scraped)Knowledge base articles, documentation sites
DocumentOdoo Documents app filesInternal documents already in Odoo
Knowledge ArticleOdoo Knowledge app articlesWiki 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

StatusMeaningAction Required
ProcessingBeing chunked and embeddedWait for cron job to complete
IndexedReady for use in RAG queriesNone - source is active
FailedError during processingCheck 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 TypeAuto-UpdateExample Use Case
Char, Text, HTMLYes (on save)Product descriptions, summaries
SelectionManual triggerPriority classification, categories
Many2oneManual triggerAuto-assign salesperson, category
Many2many (Tags)Manual triggerAuto-tagging based on content
Integer, Float, MonetaryManual triggerScoring, estimated values
Date, DatetimeManual triggerSuggested deadlines
BooleanManual triggerYes/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

  1. Trigger: Automation rule fires (on create, update, scheduled, etc.)
  2. Context: AI receives record data, available tools, and prompt
  3. Decision: LLM decides which tool(s) to call based on instructions
  4. Execution: Tool runs with AI-provided parameters
  5. Loop: Can call multiple tools in sequence until __end_message

Action Types That Can Be AI Tools

Action TypeWhat AI Can Do
Execute CodeRun Python code with AI-provided parameters
Create ActivitySchedule activities with AI-determined details
Create RecordCreate records with AI-populated values
Update RecordModify fields based on AI analysis
Add FollowersAdd relevant users as followers
Send WebhookTrigger external APIs with AI parameters
Post MessagePost AI-generated messages to chatter

Example: AI Lead Qualification

Scenario: Automatically qualify leads based on description and source.

  1. Create Server Action: Type = "AI"
  2. Prompt: "Analyze this lead and determine quality (hot/warm/cold). Consider: {{description}}, {{source_id.name}}, {{expected_revenue}}."
  3. Add tool: Update Record (priority field)
  4. 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

  1. Go to Website → Configuration → Livechat Channels
  2. Select your channel, go to Rules tab
  3. Create or edit a rule
  4. In AI Agent field, select your agent
  5. Configure URL pattern and conditions Note: System agents (internal) cannot be assigned to livechat.

AI Livechat Features

FeatureDescription
RAG ResponsesAnswers from uploaded knowledge sources
Lead GenerationCreates CRM leads from chat (ai_crm module)
Human EscalationTransfers to human operator when needed
Scripted Bot FallbackCan 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

AspectPredictive Lead Scoring (PLS)LLM AI (Odoo 19 AI Modules)
What it isStatistics-based predictionLanguage understanding (like ChatGPT)
Learns fromYOUR historical won/lost leads onlyBillions of internet documents + your prompts
What it outputsA number: "37% chance to win"Text: emails, summaries, classifications
Needs training data?Yes - needs your past leadsNo - works immediately with prompts
Data privacy100% local - nothing leaves your serverSent to OpenAI/Google APIs
CostFree (included in Community)Pay per API call (Enterprise only)
Best forPrioritizing leads, forecasting revenueWriting 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

  1. Document arrives: Upload, email, or scan
  2. AI analyzes: Reads content, identifies document type
  3. AI decides: Matches to folder based on configured prompts
  4. AI executes: Moves to folder, adds tags
  5. Workflow triggers: Downstream automations fire

Example: Invoice Auto-Filing

  1. Go to Documents → Configuration → Folders
  2. Select or create "Vendor Bills" folder
  3. Enable AI Auto-Sort
  4. 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.
  5. 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 /field syntax
  • 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:

  1. Create AI Field on crm.lead: "AI Priority Score" (Selection: Hot/Warm/Cold)
  2. 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).
  3. 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:

  1. Create AI Field on product.template: "Marketing Description" (HTML)
  2. 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.
  3. 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:

  1. Create AI Agent: "Customer Support Bot"
  2. Upload FAQ documents, product manuals as RAG sources
  3. Enable "Restrict to Sources" to prevent hallucination
  4. Assign agent to Livechat channel rule for website visitors
  5. 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

ModuleFeatureAuto-InstallDependencies
aiCore AI frameworkNomail
ai_appAgent management UINoai, attachment_indexation
ai_fieldsAI-computed fieldsYesai
ai_server_actionsAI in automationsYesai_fields
ai_livechatAI chatbotYesai, im_livechat
ai_documentsDocument sortingYesai, documents
ai_documents_sourceDocuments as RAG sourcesYesai, documents
ai_crmLead generationYesai, crm
ai_websiteWebsite content generationYesai, website
ai_knowledgeArticle draftingYesai, knowledge
voip_aiCall transcriptionYesai, voip
hr_recruitment_aiRejection emailsYesai, hr_recruitment
sign_aiSignature request emailsYesai, sign
ai_accountInvoice emailsYesai, account
web_studio_ai_fieldsStudio AI field creationYesai_fields, web_studio