Skip to content
Docs/odoo

Odoo

Embed the AskGPT chatbot on your Odoo website and automatically push captured leads into Odoo CRM.

Overview

AskGPT provides a native Odoo addon (askgpt_chatbot) that installs on your Odoo server. It does two things: injects the chat widget on every website page, and automatically creates a crm.lead record in Odoo CRM whenever a visitor submits their contact details through the chatbot.

  • One-click install — copy the module folder to your addons path, then install from the Apps menu
  • Configure Bot ID, position, and colors from Website → Configuration → Settings (no code required)
  • Lead sync — captured name, email, and phone are pushed to Odoo CRM in real time
  • Separate builds for Odoo 18 and Odoo 19 — download the one matching your version
  • Optional live ERP answers — the bot can look up product stock and partner balances in Odoo

Step 1 — Download the module

Go to your chatbot's Embed tab. Under Platform install guides → Odoo you'll find four download buttons — pick the module and the Odoo version you run. Each ZIP contains the complete addon with your Bot ID already referenced in the bundled README.

  • Open your chatbot → Embed tab, scroll to Platform install guides → Odoo
  • Chat Widget — Odoo 18 or Odoo 19: the chat bubble on every page
  • AI Connector — Odoo 18 or Odoo 19: trains the bot on your Odoo content and answers with live ERP data (needs the Chat Widget module too)
  • Click the button for your version — a .zip is saved to your computer

Step 2 — Install on your Odoo server

Copy the extracted askgpt_chatbot folder into your Odoo addons directory and install it from the admin panel.

  • Extract the ZIP — you get an askgpt_chatbot/ folder
  • Copy it to your Odoo addons path (e.g. /opt/odoo/custom-addons/)
  • Restart Odoo: sudo systemctl restart odoo
  • Log in as admin → Apps → Update App List
  • Search for 'AskGPT' and click Install
💡The module only depends on the built-in website module — no extra Python packages required.

Step 3 — Configure the widget

After installation, configure the widget from Odoo's website settings.

  • Go to Website → Configuration → Settings
  • Scroll to the 'AskGPT Chat Widget' section
  • Paste your Bot ID (found on the AskGPT embed page)
  • Choose Bottom Right or Bottom Left position
  • Optionally enter primary/accent color overrides
  • Click Save — the widget appears on every page immediately
Bot ID location: AskGPT Dashboard → your chatbot → Embed tab → data-bot-id value

Step 4 — Enable Odoo CRM lead sync (optional)

When lead sync is enabled, every visitor who shares their contact details is automatically added as a lead in Odoo CRM. This is configured per-chatbot in the AskGPT dashboard via the API.

  • In Odoo: Settings → Users → [your user] → Action → API Keys → New — create an API key
  • In AskGPT: PATCH /api/chatbots/{id} with the integrations.odoo object below
  • The chatbot will push name, email, phone, and source page to crm.lead on each new lead
  • Failures are silently logged — they never interrupt the chat response
PATCH /api/chatbots/{botId} { "integrations": { "odoo": { "enabled": true, "url": "https://mycompany.odoo.com", "db": "mydb", "username": "admin@example.com", "apiKey": "your-odoo-api-key", "teamId": 1 } } }
💡teamId is optional — if set, leads are assigned to that CRM sales team. Omit it to use Odoo's default. The API key is encrypted at rest and preserved on later updates, so you can toggle flags without re-sending it.

Step 5 — Live ERP answers (optional)

With liveData enabled, the chatbot can query your Odoo database in real time and answer questions like 'How many units of Product X are in stock?' or 'What is the outstanding balance of Partner Y?'. Lookups run server-side over JSON-RPC using the same credentials as lead sync.

  • Product stock — searches product.product by name or internal reference; returns quantity on hand, forecasted quantity, and list price (requires the Inventory app)
  • Partner balance — searches res.partner by name; returns total receivable and payable (requires the Accounting app)
  • The AI only answers from the returned records — it is instructed never to invent quantities or amounts
PATCH /api/chatbots/{botId} { "integrations": { "odoo": { "liveData": true } } }
💡Anyone who can chat with the widget can trigger these lookups, so only enable liveData on internal or trusted deployments — or use a dedicated Odoo user whose record rules limit what the bot can see.

AskGPT AI Connector — what it is

The AI Connector (askgpt_ai_connector) is the second, more powerful module. Where the Chat Widget just embeds the bubble, the Connector turns Odoo into the chatbot's brain: it trains the bot on your own Odoo content and lets it answer visitors with live data straight from your database — the same idea as Odoo 19 Enterprise's AI app, but powered by AskGPT and running on Community 18 and 19.

  • Content sync — your published pages, products and blog posts become the bot's knowledge base, kept up to date automatically
  • Live ERP answers — define read-only 'AI Tools' and the bot queries Odoo in real time (stock, order status, balances, or anything you choose)
  • Fully self-hosted trust model — AskGPT never stores an Odoo login; it calls back your server with a rotating shared secret and only ever receives the fields you whitelist
  • One codebase, two versions — download the Odoo 18 or Odoo 19 build; they behave identically
💡The Connector depends on the Chat Widget module — installing it pulls the widget in automatically.

Connector Step 1 — Install & connect

Install the module, then connect it to your chatbot with a bot API key. The key is a server-to-server credential, separate from your login, so the sync never needs your AskGPT password.

  • Download 'AI Connector' for your Odoo version and install it (Apps → Update App List → install 'AskGPT AI Connector')
  • In AskGPT: your chatbot → Embed → API key → Generate. Copy the key (shown once, format agk_…)
  • In Odoo: Website → Configuration → Settings → AskGPT AI Connector → paste the API Key
  • Make sure the Bot ID and App URL are already set in the AskGPT Chat Widget block above, then Save
💡The API key is stored encrypted and only visible to Odoo system administrators. Regenerate it anytime in AskGPT — old keys stop working immediately.

Connector Step 2 — Train the bot on your content

In the same settings block, choose what to sync — Website Pages, Products, Blog Posts — and click 'Sync now'. Only published records are sent. Everything is checksum-tracked, so re-syncing pushes only what changed and removes anything you unpublished or deleted.

  • Website Pages — the visible text of every published page
  • Products — name, price, sales description and eCommerce description of every published product (website_sale)
  • Blog Posts — the full body of every published post (website_blog)
  • Automatic Daily Sync — tick it to have a cron push changes once a day, hands-free
  • Every document and its result is listed under Website → Configuration → AskGPT → AskGPT Sync Log
💡Syncing embeds the content into your bot's knowledge base and consumes AskGPT credits like normal training (1 credit per chunk). Unchanged pages on a re-sync cost nothing.

Connector Step 3 — AI Tools (live data answers)

An AI Tool is a read-only query you allow the chatbot to run. Create them under Website → Configuration → AskGPT → AskGPT AI Tools. Installing the module auto-creates handy defaults for whichever apps you have: product_stock (Inventory), partner_balance (Accounting) and sale_order_status (Sales). Each tool is fully under your control:

  • Tool Name — the technical name the AI calls, e.g. product_stock (lowercase, digits, underscores)
  • Description — plain-English instructions telling the AI what the tool answers and when to use it (this is how the AI decides to call it)
  • Model — the Odoo model it reads, e.g. product.product, sale.order, res.partner
  • Search Field — the field matched against the visitor's question (e.g. product name)
  • Fields Returned — a whitelist of exactly which fields go back to the bot; nothing outside this list ever leaves Odoo
  • Domain Filter — an optional always-on filter, e.g. [('is_published', '=', True)] to limit scope
  • Max Records — cap on rows returned per call (hard limit 20)
💡Design principle: anything a tool can return, a website visitor can ask for. Keep field whitelists minimal, add domain filters, and only expose data you're comfortable showing publicly — or point the tool at a dedicated Odoo user whose record rules limit what it can see.

Connector Step 4 — Push tools & go live

After creating or editing tools, click 'Push tools' in the settings block. This registers them with your chatbot and generates a one-time shared secret. From then on the AI decides, on its own, when a visitor's question needs live data and calls the matching tool.

  • Push tools — sends the tool list (names, descriptions, argument schemas) to AskGPT
  • A random shared secret is created and stored on both sides on first push
  • The bot now answers questions like 'Is the X in stock?' or 'What's my order status?' with real Odoo data
  • Re-push whenever you add, edit, archive or remove a tool

How live tool execution works (security)

When the AI calls a tool, AskGPT does NOT touch your database directly. It sends the request back to a secured endpoint on your own Odoo server, which runs the whitelisted query and returns only the allowed fields. Your data never leaves your server except as the exact result you configured.

Visitor: "How many Widget Pro are in stock?" │ ▼ AskGPT bot picks tool "product_stock" │ POST /askgpt/tools/execute (X-AskGPT-Secret: ••••) ▼ Your Odoo runs a read-only search_read on product.product │ returns only the whitelisted fields ▼ AskGPT folds the result into a natural-language answer
💡The callback secret is compared in constant time, the query is read-only, and AskGPT stores no Odoo credentials. If the secret is wrong the endpoint returns 401; unknown tools return 404.

How the widget injection works

The addon extends Odoo's website.layout QWeb template, injecting an async <script> tag at the end of <body> when a Bot ID is configured. The widget loads from your AskGPT server URL and reads all settings (colors, position, welcome message) from the AskGPT API automatically — you don't need to set them in Odoo.

<!-- Injected automatically by askgpt_chatbot module --> <script src="https://askgpt.asksol.pk/widget.js" data-bot-id="YOUR_BOT_ID" data-position="bottom-right" async> </script>

Troubleshooting

Common issues when installing the Odoo module:

  • Module not found after update — confirm the folder is named exactly askgpt_chatbot (no spaces or extra chars)
  • Widget not visible — check that the Bot ID is saved in Website Settings and the chatbot is published in AskGPT
  • CRM leads not appearing — verify the API key is active, the Odoo URL has no trailing slash, and the db name matches exactly
  • Template error on install — run with --dev=all and check the Odoo server log for XML parse errors
  • Connector: 'Sync now' fails — confirm the bot API key (agk_…) is pasted and saved, and the App URL points at your AskGPT server
  • Connector: bot ignores live data — click 'Push tools' after any tool change, and check the tool's Description clearly tells the AI when to use it
  • Connector: tool returns nothing — widen the Search Field or Domain Filter, and make sure the required app (Inventory/Accounting/Sales) is installed

Need more help?

Contact support and we'll get back to you within 24 hours.