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

# Odoo ERP

> Connect CommissionKit to Odoo to sync sales reps and deals from the Sales or CRM app

Connect your Odoo instance to CommissionKit. The connector works with Odoo Community and Enterprise editions, version 15 and above. It syncs reps and deals automatically.

## How data flows

**Sales app path** (quotation → order):

```
Odoo Sales app                CommissionKit
──────────────                ───────────────

Quotation created        →    Deal created (stage = pending)
        │
        ▼
Quotation confirmed      →    Deal updates (stage = closed_won)
        │
        ▼
Invoice created + paid   →    Payment status updates to "paid"
```

**CRM app path** (opportunity → quotation → order):

```
Odoo CRM app                  CommissionKit
─────────────                 ───────────────

Lead / Opportunity             (not synced)
        │
        ▼
Opportunity marked "Won"
        │
        ▼
Quotation created
from the opportunity     →     Deal created (stage = pending)
        │
        ▼
Quotation confirmed      →     Deal updates (stage = closed_won)
        │
        ▼
Invoice created + paid   →     Payment status updates to "paid"
```

In both paths, the final record CommissionKit reads is **`sale.order`**. All states (`draft`, `sent`, `sale`, `done`, `cancel`) are synced by default.

## CRM: opportunity pipeline

If you use Odoo's **CRM** app, opportunities must have a **quotation** created manually before they appear in CommissionKit. CommissionKit reads `sale.order` records — not CRM opportunities. If your team marks an opportunity as "Won" without creating a quotation, it will never sync.

To get a won opportunity into CommissionKit:

1. Open the opportunity in Odoo CRM
2. Click **New Quotation** to create a sale order from the opportunity
3. Confirm the quotation so its state becomes **Sale Order** or **Done**
4. Run a manual **Sync Deals** in CommissionKit to pull it in

## Stage mapping

Raw Odoo sale order states map to CommissionKit's canonical stages:

| Odoo state | CKit stage    |
| ---------- | ------------- |
| `draft`    | `pending`     |
| `sent`     | `pending`     |
| `sale`     | `closed_won`  |
| `done`     | `closed_won`  |
| `cancel`   | `closed_lost` |

All states are synced by default. Use the **⋮** menu → **Stage Filter** to select which states to import.

## Payment status (invoice-based)

CommissionKit determines payment status from **actual invoice payment states**, not `sale.order.invoice_status`.

| Invoice payment states              | Resulting CKit status |
| ----------------------------------- | --------------------- |
| All invoices `paid` or `in_payment` | **paid**              |
| Some paid, some unpaid              | **partial**           |
| No invoices attached                | **unpaid**            |
| Any invoice `reversed` or `cancel`  | **on\_hold**          |

For closed-won deals with no invoices yet, the status comes from **⋮** → **Payment Defaults** (defaults to `paid`).

<Note>
  `sale.order.invoice_status` is NOT used. That field only tracks whether invoices have been **created**, not whether they have been **paid**.
</Note>

## Connector features

| Option                     | What it does                                          |
| -------------------------- | ----------------------------------------------------- |
| **Sync Reps / Sync Deals** | Manual sync triggers                                  |
| **Auto Sync**              | Schedules automatic syncs                             |
| **Stage Filter**           | Select which Odoo states to import                    |
| **Payment Defaults**       | Default payment status for won deals without invoices |
| **Disconnect**             | Remove the connection                                 |

## Prerequisites

* Odoo 15+ (Community or Enterprise, self-hosted or Odoo.sh)
* A user account with API access — generate an API key under **Settings > Users & Companies > Users > \[User] > API Keys**
* The **Sales** module (`sale`) must be installed. No other modules required.

## Setup

1. In Odoo, generate an API key for a user with sales access
2. In CommissionKit, go to **Integrations** and select **Odoo ERP**
3. Enter:
   * **Odoo Instance URL** — e.g. `https://mycompany.odoo.com`
   * **Database Name** — your Odoo database name
   * **Username** — the email of the user with API access
   * **API Key** — the key generated in step 1
4. Click **Test Connection** to verify
5. Click **Connect** — initial sync begins immediately
