Skip to content

Odoo Webhook

Odoo Webhook is a starting component: it starts the flow when a record of the type you choose is created or changed in your Odoo, for example a sales order, an invoice or a contact. Nothing needs to be set up in Odoo: once subscribed, NappAI checks your Odoo about every minute and runs the flow with the records created or changed since the last check.

When to use it

  • Every new sales order should notify the warehouse by message.
  • When an invoice is posted you want to send it to another system or save its details in a spreadsheet.
  • A contact’s details change in Odoo and you want them updated in your marketing tool too.
  • You want an AI agent to review every new CRM opportunity and prepare a first message.

Configuration

You need an Odoo API credential with your Odoo server address, the database name, your user and an Odoo API key. See Credentials.

FieldWhat it does
Credential (required)Your Odoo’s Odoo API credential.
Odoo ModelThe kind of record that is watched: sale.order (sales orders), account.move (invoices and journal entries), stock.picking (delivery notes), account.payment (payments), product.product (products), res.partner (contacts), crm.lead (opportunities) or note.note (notes; from Odoo 17, the To-do app’s to-dos). Default: sale.order.
EventsWhich changes start the flow: Record Created, Record Updated or both. Default: both.
DataFor testing the component: paste a sample of what arrives here and run the flow to see the result.

Advanced options

FieldWhat it does
Additional Domain FilterAn extra condition, written the way Odoo writes it, to watch only some records. For example, [["state", "=", "sale"]] watches only confirmed orders. Leave it empty to watch all.

Turning on the subscription

  1. Deploy a version of the flow. The subscription needs a deployed version. See Versions and publishing.
  2. In the component, below its fields, click Subscribe. The API Access window opens on the Odoo Webhook tab.
  3. Click Subscribe. The tab shows whether the subscription is Synced with the component’s settings, the subscribed model and events, and how many seconds pass between checks of Odoo.
  4. If you change the component’s model or events, the tab shows Out of sync: subscribe again. To stop receiving changes, click Unsubscribe.

Output

The Data output returns one item per record created or changed, with:

  • event: created if the record is new or updated if it was changed.
  • model: the kind of record, for example sale.order.
  • id and name: the record’s ID and name.
  • write_date: the date and time of the last change.
  • record: all the record’s details as Odoo stores them.

Connect Data to an agent, a messaging component or the Odoo component to keep working with the record.

Example

A distributor wants to notify the warehouse every time a sales order comes in.

  1. Add Odoo Webhook with your Odoo credential, Odoo Model set to sale.order and Events with Record Created only.
  2. Connect Data to an agent that writes a notice with the customer and the order amount, and that agent to a messaging component.
  3. Deploy the flow and subscribe from the component.

Good practices

  • The first check after you subscribe also picks up the records changed in the last 24 hours. Keep it in mind if the flow sends notices.
  • Each check picks up at most 100 records; the rest arrive in the following checks.
  • A record counts as created when its last change is less than a minute after it was created. If someone edits it right after creating it, it may arrive as created.
  • Use Additional Domain Filter so the flow does not run for records you don’t care about.
  • Odoo: create, look up and confirm Odoo records.