Odoo
Connect an Odoo database to run your business operations from a process. metamorphOS calls the Odoo API to manage opportunities and contacts, build and confirm quotations, raise and post customer invoices, place vendor orders, read stock levels, and — through Odoo’s automation rules — start a process when a record changes.
What you can do
- CRM: create, find, read, update and delete opportunities (
crm.lead), and manage the contacts and companies behind them. - Sales: build a quotation, add priced positions, read its totals and lines, confirm it into a sales order, and cancel it.
- Invoicing: raise a customer invoice, add lines, post it to assign its number, and read whether it has been paid.
- Purchase: place a vendor order, add positions, and confirm it (Odoo creates the receipt).
- Inventory: read a product’s on-hand, forecasted, incoming and outgoing stock levels, and list warehouse transfers (receipts and deliveries).
- Record events: trigger a process when an opportunity is created, its stage changes, or it is won or lost; when a contact is created; when a quotation is created or an order confirmed; when an invoice is paid; or when a warehouse transfer is completed.
Before you start
You need:
- An Odoo 19 or newer database. metamorphOS uses Odoo’s JSON‑2 API
(
/json/2), which ships with Odoo 19; earlier versions are not supported. - An Odoo user with permission for the records you want to touch. An API key inherits its user’s access rights, so choose (or create) a user scoped to what the integration should be allowed to do.
- The relevant apps installed. Contacts and CRM work on any Odoo database. Quotations and products need Sales; invoices need Invoicing (Accounting); vendor orders need Purchase; stock levels and transfers need Inventory. Install them from Odoo’s Apps screen.
Set up Odoo
- Create an API key. In Odoo, click your avatar (top‑right) → My Profile → the Account Security tab → New API Key. Give it a name (for example, metamorphOS), confirm your password, and copy the key. Odoo shows it only once, so store it safely — it is the secret you give metamorphOS.
- Note your instance host. This is your Odoo address without the scheme — for
example
acme.odoo.comfor an Odoo Online database, or your self‑hosted host such asodoo.acme-internal.de. - Note your database name. For Odoo Online this is the subdomain (for
example
acmeforacme.odoo.com). It is only strictly required when one host serves several databases, but supply it anyway.
Connect in metamorphOS
Activate the Odoo connector from the marketplace, add an account, and provide:
- API key: the key you created in Odoo’s Account Security. It is sent as a bearer token on every request.
- Instance host: your Odoo host without the scheme (for example
acme.odoo.com). - Database: your Odoo database name (for Odoo Online, the subdomain).
Each account can point at a different Odoo database, so one workspace can drive several Odoo instances.
React to Odoo events
Odoo sends events through Automation Rules, which run a Send Webhook Notification action when a record changes. You set one rule up per event.
First, make the feature available (once per database):
- Turn on developer mode: Settings → General Settings, scroll to the Developer Tools section, and click Activate the developer mode.
- Check for Settings → Technical → Automation Rules. If that menu is missing, open Apps, search Automation Rules, and install it — it does not come installed by default.
Then, for each event you care about:
- Go to Settings → Technical → Automation Rules → New.
- Set the Model and pick the Trigger from the table below. For triggers that need a condition (won, order confirmed, invoice paid, picking done), set the rule’s Apply on filter to the domain shown.
- Under Actions To Do, click Add an action → Send Webhook Notification.
- Paste the callback URL metamorphOS gives you for that event into the action’s URL field.
- In the action’s Fields, add the fields listed below — always include the record’s id. Use Sample Payload on the action to preview exactly what Odoo will send.
- Save, and make sure the rule’s toggle is on.
| Event | Model | Trigger | Apply-on filter | Include these fields |
|---|---|---|---|---|
| Opportunity created | crm.lead | On Creation | — | id, name, email_from, expected_revenue |
| Opportunity stage changed | crm.lead | Stage is set | — | id, name, stage_id |
| Opportunity won | crm.lead | Stage is set | your Won stage | id, name, expected_revenue, stage_id |
| Opportunity lost | crm.lead | On Archived | — | id, name |
| Contact created | res.partner | On Creation | — | id, name, email |
| Quotation created | sale.order | On Creation | — | id, name, partner_id, amount_total |
| Order confirmed | sale.order | On Update | state = sale | id, name, amount_total |
| Invoice paid | account.move | On Update | payment_state = paid | id, name, amount_total, payment_state |
| Picking done | stock.picking | On Update | state = done | id, name, origin, state |
Each event has its own callback URL — metamorphOS matches an incoming
delivery to the right process by that URL, so give every rule the URL for its own
event. Odoo sends a linked field (like stage_id or partner_id) as its numeric
id; metamorphOS maps that for you, so just include the field and pick it up in
your process.
Good to know
- Webhooks are not signed. Odoo’s webhook action sends no signature and no custom headers, so the callback URL is the secret — treat it like a password, and only ever use the HTTPS URL metamorphOS provides. Anyone who knows the URL can post events to it.
- The API key carries the user’s rights. To limit what the integration can do, scope the Odoo user whose key you use.
- Odoo derives prices and totals. When you add a quotation, invoice or purchase line, you only need the product and quantity — Odoo fills in the unit price from the product and recomputes the tax and totals.
- Reading payment status vs. taking payment. You can see whether an invoice is paid (and react to it with Invoice paid), but registering a payment is not part of the connector — that is normally done from your bank feed or by your accounting team.
- Confirming creates permanent records. Confirming a sales or purchase order moves stock and writes an audit trail that Odoo will not let you delete. That is expected — cancel rather than delete once an order has been confirmed.
- Deleting is guarded. Posted invoices and confirmed orders must be reset to draft or cancelled before they can be deleted, and a product that has appeared on an order or a stock move can be archived but not deleted. This mirrors Odoo’s own rules.