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.
| Field | What it does |
|---|---|
| Credential (required) | Your Odoo’s Odoo API credential. |
| Odoo Model | The 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. |
| Events | Which changes start the flow: Record Created, Record Updated or both. Default: both. |
| Data | For testing the component: paste a sample of what arrives here and run the flow to see the result. |
Advanced options
| Field | What it does |
|---|---|
| Additional Domain Filter | An 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
- Deploy a version of the flow. The subscription needs a deployed version. See Versions and publishing.
- In the component, below its fields, click Subscribe. The API Access window opens on the Odoo Webhook tab.
- 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.
- 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:createdif the record is new orupdatedif it was changed.model: the kind of record, for examplesale.order.idandname: 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.
- Add Odoo Webhook with your Odoo credential, Odoo Model set to
sale.orderand Events withRecord Createdonly. - Connect Data to an agent that writes a notice with the customer and the order amount, and that agent to a messaging component.
- 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.
Related components
- Odoo: create, look up and confirm Odoo records.