> ## Documentation Index
> Fetch the complete documentation index at: https://docs.tala-assistant.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Odoo

> Identify callers and manage CRM leads during voice calls

## Overview

The Odoo integration enables your voice agents to interact with your
Odoo ERP in real-time during calls. Identify callers from your contacts
database and automatically create CRM leads from conversations.

<Note>
  This integration requires an API key from the Odoo user account used for
  the integration. In Odoo, go to **Preferences** -> **Account** ->
  **API Keys** -> **New API Key**.
</Note>

## What You Can Do

| Feature               | Description                                                                                               |
| --------------------- | --------------------------------------------------------------------------------------------------------- |
| **Identify Callers**  | Look up contacts by phone number to personalize calls                                                     |
| **Create CRM Leads**  | Capture opportunities directly in Odoo during the call                                                    |
| **Auto-create Leads** | Automatically create a lead after eligible calls when no lead was already created during the conversation |
| **Link Contacts**     | Associate leads with existing Odoo contacts                                                               |

## Setup

<Steps>
  <Step title="Generate an API Key">
    In Odoo, go to **Preferences** -> **Account** ->
    **API Keys** -> **New API Key**.

    You will need:

    * Odoo instance URL (e.g. `https://mycompany.odoo.com`)
    * Database name (visible in Settings -> Database)
    * User email
    * API key (just generated)
  </Step>

  <Step title="Add Integration">
    Go to **Integrations** -> Click **Add Odoo** -> Enter your credentials
  </Step>

  <Step title="Test Connection">
    Click **Test** to verify your credentials work correctly
  </Step>

  <Step title="Use in Calls">
    Your agent has access to Odoo tools when the integration is active
  </Step>
</Steps>

## Available Tools

Your agent has access to two functions:

| Tool               | Use Case                                             |
| ------------------ | ---------------------------------------------------- |
| **Lookup Contact** | At call start, identify the caller by phone number   |
| **Create Lead**    | When caller expresses a need or business opportunity |

## Example Conversations

<AccordionGroup>
  <Accordion title="Caller Identification">
    **\[Call starts - agent can look up the phone number]**

    **Agent:** Bonjour ! Je vois que je parle avec Jean Dupont de ACME Corp.
    Comment puis-je vous aider aujourd'hui ?

    **Caller:** Oui, c'est bien moi. J'appelle pour un devis de renovation.

    **Agent:** Parfait, je note votre demande de devis renovation.
  </Accordion>

  <Accordion title="Lead Creation">
    **Caller:** J'aimerais un devis pour renover ma salle de bain.

    **Agent:** Bien sur ! J'enregistre votre demande dans notre CRM.
    Quel est votre budget approximatif ?

    **Caller:** Environ 15 000 euros.

    **Agent:** C'est note. J'ai cree une fiche dans notre systeme avec votre
    demande de devis renovation salle de bain. Un commercial vous recontactera
    rapidement.
  </Accordion>

  <Accordion title="Unknown Caller">
    **\[Call starts - phone number not found in Odoo]**

    **Agent:** Bonjour ! Bienvenue chez ACME Corp. Puis-je avoir votre nom ?

    **Caller:** Marie Martin.

    **Agent:** Merci Marie. Comment puis-je vous aider ?
  </Accordion>
</AccordionGroup>

## Post-Call Automation

With an active Odoo integration, Tala can automatically create a CRM lead in
Odoo after a call if no lead was already created during the conversation, with:

* Call summary as lead title
* Contact name and phone from the conversation
* Call disposition and gathered context as description
* Linked to existing Odoo contact if found by phone number

## Technical Details

| Setting            | Value                                   |
| ------------------ | --------------------------------------- |
| Auth Method        | JSON-RPC with API key                   |
| Voice Call Timeout | 3 seconds (optimized for real-time)     |
| Post-Call Timeout  | 10 seconds                              |
| UID Caching        | 24 hours (automatic)                    |
| Data Encryption    | Fernet (AES-128) for stored credentials |
| SSRF Protection    | HTTPS only, DNS resolution validated    |

## Odoo Modules Used

| Module   | Model         | Usage                        |
| -------- | ------------- | ---------------------------- |
| Contacts | `res.partner` | Phone-based contact lookup   |
| CRM      | `crm.lead`    | Lead creation and management |

## Limitations

<Warning>
  **Current limitations:**

  * Calendar integration is not yet available (use Google Calendar or Calendly instead)
  * Only Odoo instances with HTTPS are supported
  * The API key user must have read access to Contacts and write access to CRM
</Warning>

## Troubleshooting

<AccordionGroup>
  <Accordion title="Authentication failed">
    * Verify the database name matches exactly (case-sensitive)
    * Check that the API key was generated for the correct user
    * Ensure the instance URL is correct and uses HTTPS
    * Try generating a new API key
  </Accordion>

  <Accordion title="Contact not found">
    * Verify the phone number exists in Odoo contacts (phone or mobile field)
    * Check that the number format matches (international vs. national)
    * The search uses the last 9 digits to handle format differences
  </Accordion>

  <Accordion title="Lead creation fails">
    * Verify the API key user has CRM module access
    * Check that the CRM module is installed on your Odoo instance
    * Ensure the user has write permissions on `crm.lead`
  </Accordion>

  <Accordion title="Connection timeout">
    * Check that your Odoo instance is accessible from the internet
    * Verify there is no firewall blocking the connection
    * Odoo.sh and Odoo Online instances should work out of the box
  </Accordion>
</AccordionGroup>

## Next Steps

<CardGroup cols={2}>
  <Card title="Workflow Tools" icon="wrench" href="/workflows/tools">
    See all available tools
  </Card>

  <Card title="Google Calendar" icon="calendar" href="/integrations/google-calendar">
    Add calendar scheduling
  </Card>
</CardGroup>
