← Documentation

Odoo

Odoo is a suite of open source business apps that cover all your company needs: CRM, eCommerce, accounting, inventory, point of sale, project management, etc.

The Odoo add-on enables seamless synchronizations of WordPress posts with Odoo’s various modules, including products, contacts, events, job offers and projects.

Odoo's apps panel

The addon

Odoo is usually extended internally via modules, but many of its features and all of its data are also available from the outside for external analysis or integration with various tools. Part of the reference/orm/model external API is easily available over JSON-RPC and accessible from a variety of languages.

To talk with this API, the add-on works with an extension of the generic REST bridge class that implements JSON RPC calls. To work properly, the add-on’s bridges requires a RPC authentication credential.

A Odoo bridge will synchronize your posts with the database of your ERP.

With Posts Bridge introspection API you’ll be able to inspect each module fields to easily map them to your post fields and taxonomies.

If your are using commercial plans from odoo.com, the external API may not be available.

Access to data via the external API is only available on Custom pricing plans. Access to the external API is not available on One App Free or Standard plans. If that is your case, check your plan before you install Posts Bridge.

How to use

The first step to use the add-on is to activate it on the add-ons table on the general settings tab.

Once activated, a new tab will be visible on the settings page. If it’s your first time, it should looks like this:

Bridge set up

An Odoo bridge will require the following components:

1. Credential

The Odoo’s external API is an RPC API protected with authentication. To solve this authentication requirement, the add-on requires you to register a RPC type of credential. These kind of credentials consists of three values:

  1. Database: The name of the database you want to connect with. Odoo can work with multiple database on a single instance. To get the name of your database, go to Settings > General Settings on the admin UI and activate the developer mode. Once activated, the database name will be visible just below your user name, on the right top corner of the screen.
  2. User login: The user login with which you want Posts Bridge to be authenticated. You can create a dedicated user or use an existing one, up to you. The login is usually an email address.
  3. Password: The password of the user. Here you can use the user password, or create an API key for this purpose. To create the token you have to go to Account > Preferences > Account Security and click on the New API key button. See the official documentation for more information about API keys.

Once you have the required information, you have to go to Settings > Posts Bridge > HTTP > Credentials on your WordPress admin page and register a new authentication credential.

Select RPC as the authentication schema and fulfill the user login, password and database fields with the corresponding values.

This is an example of a RPC authentication credential. In your case, the credential fields will be diferent based on your user credentials and instance database name.

2. Backend

To configure the Odoo’s RPC API as a backend follow this steps:

  1. Register a new backend with a unique name (Odoo RPC, for example)
  2. Set the base URL of your ERP instance as the connection URL
  3. Add Accept as an HTTP header with application/json as value.
  4. Select the RPC credential you’ve configured on the previous step

3. Post type

Posts Bridge allows you to bridge any registered post type from your WordPress site. If you’ve not registered it yet, you can register it with Posts Bridge. Go to the CPTs tab and create a new custom post type. The registration form will inherit the registration defaults, but you can modify its values at any time. The only required fields are Name, Label and Singular label.

4. Bridge

The add-on’s bridge is an extension of the generic REST bridge with some predefined defaults. Like the REST bridge, the add-on’s bridge requires a post type, a backend, but instead of an endpoint and an HTTP method, the bridge requires a model name.

The model have to match one of the available models on your instance. To get a comprehensive list of your instance available models, you have to go to Settings > Technical > Models on the Odoo’s admin UI. For example, to get your posts bridged with the contacts modules, you have to set the model field to res.partner.

Troubleshooting

To troubleshooting your bridges you can use the plugin’s debug console from the General Settings page. Enable the debug mode and submit a sample form response to see what’s going on under the hood. Take a look to our tutorial about how to use the debug console.

Common issues

  1. Authentication failures
    • Verify you’re not in a commercial plan without access to the RPC API
    • Verify the RPC credentials and database name
    • Confirm the backend URL
  2. Missing data
    • Validate field mappings
    • Validate module-specific layouts