Skip to content

Odoo actions

Who this is for: people and AI assistants who write workflow steps that read or change data in Odoo, for example to send new invoices to your accounting system, mark them paid in Odoo, or keep customers in sync with your CRM.

Before you start: you need an Odoo connection. See Connect Odoo.

These actions are part of our curated platform library. Use them in any workflow as uses: library/odoo.<name>@v1. Each action uses one connection slot, odoo, which takes a connection made from the Odoo template. You find the same actions in the app under Actions, and your AI assistant reads their full contracts with the MCP tool get_action.

Action What it does Access the bot user needs
library/odoo.find-customers@v1 Finds customers by reference, email, VAT number or name (only reads) read contacts
library/odoo.get-customer@v1 Reads one customer (only reads) read contacts
library/odoo.upsert-customer@v1 Updates a customer, or creates one when none matches create and change contacts
library/odoo.find-changed-sales-orders@v1 Lists sales orders changed since a time (only reads) Sales, all documents
library/odoo.get-sales-order@v1 Reads one sales order with its lines (only reads) Sales, all documents
library/odoo.create-sales-order@v1 Creates a quotation from a webshop or form order, once per shop order number Sales, all documents, and read contacts and products
library/odoo.confirm-sales-order@v1 Confirms a quotation, which makes it a sales order Sales, all documents
library/odoo.find-changed-invoices@v1 Lists customer invoices changed since a time, with what is still due (only reads) Invoicing or Accounting
library/odoo.find-invoice-by-number@v1 Finds one confirmed invoice by its number or payment reference (only reads) Invoicing or Accounting
library/odoo.get-invoice-pdf@v1 Saves the PDF Odoo stored for a confirmed invoice as a file of the run (only reads) Invoicing or Accounting, and read the invoice’s attachments
library/odoo.create-invoice-from-order@v1 Creates an invoice from a confirmed sales order Sales and Invoicing
library/odoo.register-payment@v1 Registers a payment on an invoice register payments in Invoicing or Accounting
library/odoo.get-stock-levels@v1 Reads the On Hand quantity of products (only reads) Inventory

Give the bot user only the access for the actions you use. See Connect Odoo.

  • Only your database. The actions call only the address of the connection, through Odoo’s JSON-2 API. No input can change where a request goes.
  • Only the data it needs. Each action asks Odoo for a fixed, short list of fields, never every field. It keeps personal data out of your runs.
  • Empty is null. Odoo writes an empty field as false. The actions give null instead, so a missing email is null, not false. A link to another record, such as an order’s customer, is that record’s id.
  • Exact matches. A search by reference, VAT number or name matches the whole value as it is. A search by email ignores upper and lower case but still matches the whole address. Odoo treats _ in a search as “any character”, so the actions check every answer again and keep only exact matches.
  • Times are UTC. Odoo stores dates and times in UTC. since takes a time like 2026-10-16T08:00:00Z or with an offset like 2026-10-16T10:00:00+02:00, and the outputs show times as Odoo does, like 2026-10-16 08:00:00, in UTC.
  • Pages, with a limit. The “changed since” actions read a page at a time, up to max_pages pages and max_items records. When more may follow, the output says truncated: true. Use next_since as the next run’s since. A record changed in that same second can come again, but none is skipped.
  • One request a second on Odoo Online. Odoo asks for about one request per second. Runs that use the same connection share it and wait their turn.
  • Errors. A failed step says what it tried to do, the HTTP status and what to check, such as a missing access right or an expired API key. Odoo’s own error text and its technical details are left out, because they can contain names from your records and details of the server.

These actions share these rules:

  • Read first, then write. Odoo has no way to tell that a request was sent twice. So each action reads the record first and writes only what is still missing. Running the step again is safe: it finds the customer it created, sees the order is already invoiced, or sees the invoice is already paid.
  • Dry runs and test runs change nothing. In a dry run, Liitora holds back the change and logs it as “would have sent”. The reads before it still run for real. The step succeeds with dry_run: true and status: dry_run. A test run that uses a production connection holds the change back the same way.
  • A person approves it first. Like every workflow, a version that uses these actions runs for real only after an admin approves it. See Approve a workflow.
  • Never sent again after a timeout. If Odoo doesn’t answer in time, the request is not sent again, because Odoo may already have done it. The step fails with a plain message. Look at the record in Odoo before you run it again, or let the step read first and decide, as these actions do.

Finds customers (Odoo contacts) by one value. Give exactly one of ref, email, vat and name.

Input Required What it is
ref one of the four The customer reference, matched exactly.
email one of the four The email address, matched without case.
vat one of the four The VAT or tax number, matched exactly.
name one of the four The customer’s name, matched exactly.
include_archived no Also find archived customers. Default false.
limit no At most this many customers, 1 to 100 (default 20).

Outputs: customers (each with id, name, ref, email, vat, phone, is_company, parent_id, active, company_id and write_date), count, unique and truncated.

Odoo doesn’t keep references, email addresses or VAT numbers unique. Check unique before you use customers[0].

- id: customer
name: Find the customer
uses: library/odoo.find-customers@v1
connections:
odoo: odoo
with:
email: ${{ trigger.body.email }}

Reads one customer by id, archived or not.

Input Required What it is
id yes The customer’s id in Odoo.

Outputs: found (true or false) and customer (as in odoo.find-customers, or null).

Finds a customer and updates it, or creates it when there is none. It looks by ref first, then by email, and archived customers count too, so an archived customer is never created again.

Input Required What it is
ref one of the two Match by this customer reference first.
email one of the two Then match by this email address, exactly and without case.
values yes The fields to set: name, ref, email, phone, vat, street, street2, city, zip, website and is_company. null empties a field. Fields you leave out are not changed. To create a customer, values needs name.

Outputs: status (created, updated or dry_run), id, matched_by (ref, email, or null when it was created), archived (the customer found is archived; it is updated but stays archived) and dry_run.

If more than one customer has the reference, or (with no reference match) the email address, the step fails and nothing is written. Merge or fix the duplicates in Odoo first. A new customer gets the ref and email you matched by, unless values sets others.

- id: sync
name: Create or update the customer in Odoo
uses: library/odoo.upsert-customer@v1
connections:
odoo: odoo
with:
ref: ${{ trigger.body.customer_number }}
email: ${{ trigger.body.email }}
values:
name: ${{ trigger.body.company }}
phone: ${{ trigger.body.phone }}
is_company: true

Lists sales orders changed at or after a time, oldest change first.

Input Required What it is
since yes Only orders changed at or after this time (UTC). Use next_since of the previous run.
only_confirmed no Only confirmed sales orders, no quotations. Default false.
page_size no Orders per request, 1 to 200 (default 100).
max_pages no Requests at most, 1 to 50 (default 10).
max_items no Orders at most, 1 to 5000 (default 1000).

Outputs: orders (each with id, name (the order number), state, partner_id, partner_name, date_order, client_order_ref, amount_untaxed, amount_total, currency, invoice_status, invoice_ids, company_id and write_date), count, truncated and next_since.

Reads one sales order by id, with up to 500 lines.

Input Required What it is
id yes The sales order’s id in Odoo.

Outputs: found, order (as in odoo.find-changed-sales-orders, or null), lines (each with id, product_id, product_name, description, quantity, quantity_delivered, quantity_invoiced, price_unit, discount, price_subtotal and price_total) and lines_truncated.

Lists customer invoices changed at or after a time, oldest change first, with their payment state and the amount still due.

Input Required What it is
since yes Only invoices changed at or after this time (UTC). Use next_since of the previous run.
only_posted no Only confirmed (posted) invoices, no drafts. Default false.
include_credit_notes no Also list customer credit notes. Default false.
page_size no Invoices per request, 1 to 200 (default 100).
max_pages no Requests at most, 1 to 50 (default 10).
max_items no Invoices at most, 1 to 5000 (default 1000).

Outputs: invoices (each with id, name (the invoice number), move_type, state, payment_state, in_payment, paid, partner_id, partner_name, invoice_date, invoice_date_due, invoice_origin (the sales order it came from), ref, amount_total, amount_due, currency, company_id and write_date), count, truncated and next_since.

in_payment means a payment is registered but not yet matched with the bank transaction. paid means Odoo marks it Paid. See Paid or In payment.

- id: invoices
name: Read the invoices changed since the last run
uses: library/odoo.find-changed-invoices@v1
connections:
odoo: odoo
with:
since: ${{ state.last_invoice_sync }}
only_posted: true

Finds the one confirmed (posted) customer invoice with an invoice number or a payment reference, for example the one a payment provider or your bank reports. Give exactly one of number and payment_reference.

Input Required What it is
number one of the two The invoice number as Odoo shows it, like INV/2026/00010, matched exactly.
payment_reference one of the two The invoice’s payment reference, matched exactly. In Odoo it is usually the invoice number, unless your company uses structured bank references.
payment_memo no A payment memo, matched exactly. When you give it, the step also says whether the invoice already has a payment with this memo.

Outputs: found and invoice, or null when no invoice matched. invoice has id, name (the invoice number), move_type, state, payment_state, in_payment, paid, partner_id, partner_name, invoice_date, invoice_date_due, invoice_origin, ref, payment_reference, amount_total, amount_due, currency and company_id, as in odoo.find-changed-invoices.

With payment_memo, the output also has payment_with_memo: the invoice’s payment whose memo is exactly that text, with its id, name (the payment number), memo, amount, date and state, or null when the invoice has no such payment. Use it to never book the same payment twice: put the payment’s own id in the memo when you register it, and look for that memo before you register the next one. That also works when an earlier run registered the payment but never got Odoo’s answer. The step reads only the payments Odoo links to the invoice, so the bot user also needs to read payments, which the Invoicing app allows.

Only confirmed customer invoices are found, never drafts, credit notes or vendor bills. When nothing matches, the step succeeds with found: false, so the next step can decide what to do. Odoo does not promise that an invoice number is unique, so when two invoices match, the step fails and says so instead of picking one.

A part-paid invoice has payment_state partial and amount_due lower than amount_total. Odoo accepts a payment above the amount due without a warning, so compare the amount you are about to register with amount_due first, as the library workflow Payment received marks the Odoo invoice paid does.

- id: find
name: Find the invoice the payment is for
uses: library/odoo.find-invoice-by-number@v1
connections:
odoo: odoo
with:
number: ${{ trigger.body.invoice_number }}

Saves the PDF that Odoo stored for a confirmed (posted) customer invoice or credit note as a file of the run, so a later step can email it or upload it to a folder.

Input Required What it is
invoice_id yes The invoice’s id, for example from odoo.find-changed-invoices or odoo.find-invoice-by-number.
save_as no The file’s name in the run. It starts with a letter or a digit and has only letters, digits, dots, dashes and underscores. Default: the invoice number with other characters replaced by _, like INV_2026_00010.pdf.

Outputs: status (found or no_pdf_yet), invoice_id, invoice_number, partner_id (the customer’s id), file (the run file, as ${{ artifacts.<name> }} gives it, or null) and size (bytes, 0 when there is no PDF yet).

Odoo must have made the PDF first. Odoo stores an invoice’s PDF when someone sends the invoice or generates its PDF in Odoo, or when your own sending rules do. The action reads that stored file: Odoo has no documented way for an API key to make the PDF. For an invoice without a stored PDF, the step succeeds with status: no_pdf_yet and saves nothing, so the next step can skip it and a later run can pick it up.

The action checks that the stored file belongs to the invoice and is a PDF before it reads it, and reads PDFs of up to 7 MB. A draft invoice, a vendor bill or an invoice the bot user can’t see fails the step.

The PDF shows the customer’s name and address. Its content goes only into the run file, never into the step’s output, and Liitora leaves the bodies of Odoo’s answers out of the run log. The file is deleted with the run after your plan’s retention.

- id: pdf
name: Get the invoice PDF
uses: library/odoo.get-invoice-pdf@v1
connections:
odoo: odoo
with:
invoice_id: ${{ steps.find.output.invoice.id }}

See the library workflow New Odoo invoice PDFs to a shared folder.

Creates a regular invoice for what a confirmed sales order still has to invoice, the way the order’s Create Invoice button does. The invoice stays a draft unless you set confirm. Down payments aren’t supported.

Input Required What it is
order_id yes The id of the confirmed sales order.
confirm no Confirm (post) the new invoice. That gives it its number and makes it final: you can’t edit it without resetting it to draft. Default false.

Outputs: status (created, nothing_to_invoice or dry_run), order_id, invoice_ids, invoices (as in odoo.find-changed-invoices), confirmed and dry_run.

The action reads the order first. When the order has nothing left to invoice, it creates nothing and returns nothing_to_invoice with the order’s existing invoices, so running it again never invoices twice. A quotation that isn’t confirmed fails the step. If the order’s products are invoiced on delivered quantities, Odoo invoices only what is delivered: validate the delivery first.

Registers a customer payment on a posted invoice, the way the invoice’s Pay button does.

Input Required What it is
invoice_id yes The id of the posted customer invoice.
amount no The amount paid. Default: the whole amount due. It can’t be more than the amount due.
expected_amount_due no The amount due you expect. If Odoo shows another amount due, nothing is registered. Use it with part payments.
payment_date no The payment date, like 2026-10-16. Default: today, as Odoo sets it.
journal_id no The id of the bank or cash journal. Default: Odoo’s default journal.
memo no The payment’s memo, for example the bank reference.

Outputs: status (registered, already_paid or dry_run), invoice_id, amount_registered, payment_state, in_payment, paid, amount_due and dry_run.

It never pays twice: it reads the invoice’s payment state and amount due first, and registers nothing when the invoice is already In payment or Paid (already_paid). An invoice that isn’t confirmed (posted), or a vendor bill, fails the step.

After a payment, Odoo usually shows the invoice as In payment (in_payment: true) until your bookkeeping matches it with the bank transaction. Only then, or at once with some accounting settings, is it Paid. Both mean the payment is registered. With Odoo’s default settings, amount_due may also stay the same until the bank transaction is matched. See Paid or In payment.

- id: pay
name: Mark the invoice paid in Odoo
uses: library/odoo.register-payment@v1
connections:
odoo: odoo
with:
invoice_id: ${{ trigger.body.odoo_invoice_id }}
payment_date: ${{ trigger.body.paid_on }}
memo: ${{ trigger.body.bank_reference }}

Creates one quotation for a customer, with its lines, from an order in your webshop or a web form. Confirm it with odoo.confirm-sales-order.

Input Required What it is
partner_id yes The customer’s id, for example from odoo.upsert-customer.
client_order_ref yes The shop’s order number. Odoo keeps it as the order’s Customer Reference.
lines yes 1 to 100 lines. Each has default_code (the product’s Internal Reference) or product_id, and quantity; optionally price_unit (the price the shop charged), discount (a percentage) and description (default: the product’s name).
prices no check (the default): a shop price that differs from the product’s Sales Price in Odoo stops the step before anything is created. shop: the shop’s prices are used as they are.
partner_invoice_id no The invoice address, a contact id. Default: the customer.
partner_shipping_id no The delivery address, a contact id. Default: the customer.
date_order no The order date and time, like 2026-11-17T09:30:00Z. Default: now.
origin no The order’s Source Document, for example your shop’s name.
company_id no The company the order belongs to, when your database has several. Default: the bot user’s current company.

Outputs: status (created, exists or dry_run), order_id, order (id, name (the order number, like S00042), state, partner_id, partner_name, date_order, client_order_ref, amount_untaxed, amount_total, currency, invoice_status, invoice_ids, company_id and write_date), lines (how many lines were sent) and dry_run.

One order per shop order number. Odoo doesn’t keep the Customer Reference unique, so the action searches for it first. When an order with that reference is already there, in any state, it returns that order with status: exists and creates nothing. Running the step again for the same shop order is therefore safe. Two orders with the same reference fail the step.

Every product is checked before anything is written. An internal reference or id Odoo doesn’t know, a product that can’t be sold or is archived, or two products with the same internal reference fail the step and name the products, and no order is created. To map your shop’s product codes to Odoo’s internal references, use a lookup table in the step before.

Prices. A line without price_unit gets the product’s Sales Price. With prices: check, a shop price more than a cent away from the Sales Price stops the step and names the products, so a price change in one system isn’t missed in the other. The check uses the product’s Sales Price only, not price lists or discount rules you set in Odoo; use prices: shop when the shop’s price is the one that counts. Taxes are left to Odoo, which normally takes them from the product and the customer.

- id: order
name: Create the quotation in Odoo
uses: library/odoo.create-sales-order@v1
connections:
odoo: odoo
with:
partner_id: ${{ steps.customer.outputs.id }}
client_order_ref: ${{ trigger.body.order_number }}
lines: ${{ steps.lines.outputs.result }}
origin: Webshop

Confirms a quotation, the way its Confirm button does, which makes it a sales order (state sale).

Input Required What it is
order_id yes The quotation’s id, for example order_id from odoo.create-sales-order.

Outputs: status (confirmed, already_confirmed or dry_run), order_id, order (as in odoo.create-sales-order) and dry_run.

It reads the order first. An order that is already a sales order is left alone (already_confirmed), so running the step again is a no-op. A cancelled order fails the step: confirm it in Odoo by hand if you really want it. If someone confirms the order at the same moment and Odoo refuses the second confirmation, the action reads the order again and reports already_confirmed.

Reads the On Hand quantity of up to 100 products, across the company’s warehouses. Give either product_ids or default_codes.

Input Required What it is
product_ids one of the two Product ids.
default_codes one of the two Internal references, as in the product’s Internal Reference field.

Outputs: products (each with id, name, default_code, quantity_on_hand and active), missing (the ids or references Odoo did not find) and count. Stock per warehouse isn’t supported yet.

We built these actions from Odoo’s documentation. Where the documentation leaves out a technical name, such as the names behind the Create Invoice and Pay buttons, we checked it on Odoo 19.0 Community with Odoo’s default accounting settings, and every action ran there.

We haven’t checked these yet:

  • Odoo Online, Odoo.sh and Odoo 20.0;
  • whether a bank reconciliation alone changes an invoice’s change time, which the “changed since” actions rely on;
  • how sales taxes and a fiscal position are set on the lines of a new sales order;
  • whether Odoo replaces the stored invoice PDF when an invoice is reset to draft and confirmed again.

Try your workflows on a test database first.

What these actions return is stored with the run, like every step’s output, and deleted with the run log after your plan’s retention. Customers, invoices and payments you create stay in your Odoo database, and Odoo shows the bot user as the one who made each change. See Read run logs and Data privacy and GDPR.

Written from Odoo’s own documentation: