# Odoo connection

Integration transmits to ChatRex a published directory of the selected Odoo site. The bot will be able to find products and options, get current prices, check balances and send the buyer public links to the cards.

Integration works with Odoo 18 in Odoo.sh and local installation Odoo. It is not a channel: customers do not send messages to ChatRex through it.

## What data is transmitted

After the consent of the administrator, only the published directory data are synchronized in the selected context:

- company and website;
- Price list and currency;
- language;
- goods, options, categories and attributes;
- Prices, availability and balances of the selected warehouse.

Odoo customers, partners and orders are not transferred to ChatRex.

## Installation of the module

1. Install the app **ChatRex AI Sales Assistant** in Odoo.
2. If you are using a local server, add the module directory for Odoo 18 to `addons_path`, update the application list, and install **ChatRex eCommerce**.
3. Make sure that Odoo has a website, price list and published products.

To install the module and change the system configuration, Odoo administrator rights are required.

## Connection

1. In ChatRex, open **Integrations**.
2. Press **Connect integration**, select **Odoo** and press **Connect**.
3. On the **Connection installation** tab, click **Generate code**.
4. In Odoo, open **Website → Configuration → ChatRex → eCommerce connection**.
5. Create a connection and choose a company, website, price list, language and, if necessary, warehouse.
6. Read the terms of data transfer and confirm your consent.
7. Enter a one-time code from ChatRex and press **Connect**.
8. Return to ChatRex and wait for **Connected** status.

The code is valid until the time specified below it. If the deadline expires, click **Update code** and enter the new value in Odoo.

Once connected, ChatRex displays the selected company, site and currency. Check this information if Odoo has multiple sites or companies set up.

## Synchronization of the catalog

The module sends directory changes in the background after the operation is completed to Odoo. Therefore, a new product, price or balance may appear in ChatRex with a slight delay.

The bot uses only the latest successfully synchronized version of the directory. If actions return source availability error, check the connection status and Odoo background tasks.

## Actions bot

After connecting, configure operations in the **Integrations tab and actions**. Finding goods, obtaining a card, checking balances and obtaining a link are described in the article [**Actions Odoo**](<../../actions/integrations/odoo.md>).

## Verification

1. Publish the test product on the selected Odoo site.
2. Wait for background synchronization.
3. Start the search action in the ChatRex test chat.
4. Compare the name, option, price, currency, balance and link to Odoo.
5. Change the test price or balance and make sure the bot gets a new value after synchronization.

## Shutdown

Open Odoo integration settings in ChatRex and click **Unplug**. If necessary, also disable the connection in the settings of the Odoo module.

Once disabled, the bot will no longer be able to access the directory. To restore the connection, create a new one-time code and connect again.
