Odoo
Configure an Odoo Online company so every posted invoice becomes a Costa Rican electronic voucher.
Sello connects to Odoo Online and turns every posted customer invoice and credit note into a Costa Rican electronic voucher (comprobante electrónico v4.4) — built, signed, submitted to Hacienda, and written back onto the Odoo document.
This article is the Odoo-side setup: the plan you need, the custom fields to create, the API key to mint, and the automation rule that starts the loop. It is written for the person clicking through Odoo. The Sello-side steps (mapping config, provisioning, running the adapter) are named where they meet the Odoo side, and covered in full in the integration manual that ships with the product.
How it works
Odoo (your books) Sello (the engine) Hacienda (the tax authority)
───────────────── ────────────────── ────────────────────────────
you post an invoice ─read─▶ maps it to a v4.4 voucher
signs it with your .p12 ─send─▶ receives and validates
polls for the verdict ◀verdict─ aceptado / rechazado
clave, XML, PDF ◀write─ writes the result back
land on the invoice onto the Odoo invoiceThree rules follow from that picture, and they answer most questions before you ask them:
- Odoo owns the sale. Sello never edits your accounting. It reads posted invoices and writes back the voucher result — attachments, a chatter note, and optionally two custom fields.
- Sello owns the voucher. The legal emisor identity, the certificate, the consecutive numbering, and the whole Hacienda dialogue live in Sello. Your Hacienda registration is entered once, in Sello. Editing the Odoo company's VAT or address changes nothing on any comprobante.
- The webhook is speed; the poll is correctness. The Odoo automation rule makes a verdict land in seconds. Odoo never retries a webhook it failed to deliver, so Sello also sweeps for unfinished documents on a timer. That sweep is the guarantee. Leave it on.
Odoo Online needs the Custom plan. Studio (custom fields, automation rules) and the External API (JSON-RPC, user API keys) are Custom-plan features. On Standard, Sello cannot create the fields it reads and cannot authenticate at all, so the connection is inert. Check yours under Settings → Manage your subscription. A trial database has both, which makes it fine for a rehearsal and wrong as a home for a live connection — trials expire and take the connection with them.
Before you start
On the Odoo side:
- An Odoo Online database on the Custom plan, company country Costa Rica, currency CRC.
- Accounting installed (
account;l10n_crfor the CR chart of accounts). - A user who can read
account.move,account.move.line,res.partnerandproduct.product, and post invoices. The database administrator is simplest. - Developer mode on — Settings → bottom of the page → Developer Tools → Activate the developer mode. You need it to see technical field names and to reach Automation Rules.
On the Sello side: an account, an emisor carrying your Hacienda-registered
identity (cédula, name, provincia/cantón/distrito, economic activity), your
certificate (.p12 + PIN), and an API key.
Step 1 — Confirm the company
Settings → Users & Companies → Companies → your company. Country must be Costa Rica, currency CRC. The company Tax ID is cosmetic here: Sello holds the emisor identity that reaches Hacienda.
Step 2 — Create the custom fields
Sello reads per-tenant custom fields by technical name. Two are load-bearing; two are optional conveniences.
| Field (technical name) | Lives on | Type | What it carries | If it is empty |
|---|---|---|---|---|
x_studio_cabys | Product | Text | The product's 13-digit CABYS code | Falls back to the tenant-wide CABYS in your mapping config. The document is accepted with a code that may misclassify the product, and nothing alerts you |
x_studio_tipo_identificacion | Contact | Text | Receptor cédula type, 01–06 | Decided from the cédula's shape. A 10-digit cédula is issued as 02 jurídica, so a NITE gets the wrong type; a cédula that fits no shape parks the invoice |
x_studio_clave (optional) | Invoice | Text | Receives the Hacienda clave | Not written. The clave still arrives in the chatter note and the attachment filenames |
x_studio_estado (optional) | Invoice | Text | Receives the Hacienda status | As above |
To create one:
- Open a record of the target model — a Product form, say.
- Click the Studio toggle (the tools icon, top right).
- Drag a Text field onto the form.
- Set the Label so the technical name comes out right. Studio slugifies the
label:
Cabys→x_studio_cabys;Tipo Identificacion→x_studio_tipo_identificacion. - Close Studio, then confirm the technical name under Settings → Technical → Fields.
A field named in the mapping config must exist. Sello adds every bound field
to its Odoo read, so one missing field makes Odoo raise Invalid field and
fails every invoice on the connection, not only the one that needed it. If
Studio produced a different name, put that name in the config.
Step 3 — Set up customers
Contacts → New, or fix the customers you already have:
- Name.
- Tax ID — the receptor's cédula. It must be registered with Hacienda; an
unregistered number is a hard reject (
-38). When the customer has no identification type set, the type is decided from the cédula's shape: nine digits with no leading zero is física, eleven or twelve with no leading zero is DIMEX. Ten digits fits both jurídica and NITE, so it is issued as02jurídica. A cédula that fits no shape parks the invoice. - Email — required. It is the receptor address on the voucher and where Sello delivers the signed XML.
- Tipo Identificacion — recommended. Set
01–06rather than leaning on the shape. A NITE must set04: without it, its ten digits are issued as02jurídica.
A customer missing a cédula or an email parks the invoice instead of issuing it.
Step 4 — Set up products
Products → New:
- Name and Sales Price.
- Customer Tax — one IVA tax per line (13, 8, 4, 2, 1, 0.5 or 0 %). This becomes the voucher's rate.
- Product Type — Service or Goods. It picks the Hacienda unit of measure
(
SporUnid). - CABYS — the 13-digit code. Blank falls back to the tenant default.
Step 5 — Mint an API key
Sello authenticates with an Odoo API key, never a password.
- Avatar → My Profile, then the Security tab of the Change My Preferences dialog. (Older Odoo releases called this page Account Security.)
- Add API Key → confirm your account password when Odoo asks → name it
(
sello-adapter) → Generate. - Copy it now. Odoo shows it once, and there is no way to read it back.
The password prompt is not optional and cannot be skipped — Odoo runs an identity check before it will mint a key, even for a database administrator and even in an active session. If you manage Odoo through automation, this is the one step a person has to perform.
The key inherits that user's permissions, so mint it from a user who can read the four accounting models above and write back to them — Sello attaches the signed XML and the PDF to the invoice, posts the result to its chatter, and stamps the mapped fields. A read-only user gets you all the way to a Hacienda acceptance and then dead-letters on the write-back, with nothing on the invoice to show for it. In practice: Accounting/Billing user rights, not portal or read-only.
Step 6 — Hand the details to Sello
Give whoever provisions the connection: the database URL and name, the login and the API key from step 5, and the technical names of the fields you created. They write a small mapping config and provision the connection:
{
"version": "v1",
"bindings": {
"productCabysField": "x_studio_cabys",
"partnerCedulaTypeField": "x_studio_tipo_identificacion"
},
"defaults": {
"medioPago": "01",
"emisorCorreo": "facturacion@your-company.cr",
"cabysFallback": "7211200000100",
"actividadEconomica": "4690.0",
"naturalezaDescuento": "Descuento"
}
}Two values are yours and must be real: emisorCorreo, and
actividadEconomica in dot format (620100.0, not 620100). Check the
activity against the registry — GET /reference/ae?identificacion=<cédula> —
and use one whose estado is A.
Provisioning prints an ingest URL once. You need it for the next step.
Step 7 — Add the automation rule
This is what makes an invoice start within seconds instead of on the next sweep. Without it nothing breaks; the sweep still finds posted invoices.
- Settings → Technical → Automation Rules → New.
- Model =
Invoice(account.move). Trigger = the state change to Posted. - Action = Send Webhook Notification. URL = the
https://<adapter>/ingest/<token>line from provisioning. - Leave the default payload alone. Sello reads two things from it — the model and the record id — and ignores the rest. The webhook is a pointer, never data; the invoice is read afterwards over the External API.
Re-provisioning mints a new token and the old URL stops resolving that instant, so paste the new one the same day.
Step 8 — Verify before you issue anything
Sello ships a read-only preflight that authenticates to your database, reads its fields and modules, and reports every capability with the exact consequence of missing it. It creates and changes nothing:
ODOO_URL=https://acme.odoo.com ODOO_DB=acme \
ODOO_LOGIN=bot@acme.cr ODOO_API_KEY=… \
npx tsx scripts/odoo-acceptance/odoo-preflight.ts \
--mapping-config ./mapping.json \
--adapter-base-url https://odoo-adapter.example.cr \
--strict| Verdict | Meaning |
|---|---|
blocked | Something required is absent — the plan tier, a model, a bound field. The pipeline cannot run |
degraded | It runs with a named, exact loss — products with no CABYS, customers with no cédula type |
ok | Everything the config names is present |
Run it before you activate a connection, and again after anyone edits fields in Studio. It catches a missing bound field before that field can fail every invoice on the connection.
What lands on the invoice
Post an invoice. Within a minute or two it gains:
- the Hacienda response XML, named by the clave,
- a PDF representación gráfica,
- a chatter note with the clave and the status,
- the signed comprobante XML,
- and, if you bound them, the clave and status in
x_studio_clave/x_studio_estado.
Credit notes work the same way: reverse the invoice the normal way and post it.
Sello resolves the original clave and emits a Nota de Crédito referencing it —
código 01 for a full reversal, 04 for a partial one.
Delivery to the buyer is Sello's job, not Odoo's. Costa Rican law puts it on the emisor, and the legal artifact is the signed XML. Turn on email delivery and auto-send for the emisor, and leave Odoo's own Send & Print off unless you want the customer to get two emails.
What is and is not supported
Supported: Factura Electrónica from a posted customer invoice, Nota de Crédito from a posted credit note, per-line discounts, the seven CR IVA rates, CABYS per product with a tenant fallback, goods versus services, contado and crédito, CRC and USD at the rate Odoo booked, automatic retries, and a reconcile sweep that recovers any verdict a webhook missed.
Four things Sello files as the WRONG document — read this part
Most limits below park the invoice, which is safe: nothing is filed and you can see it did not go. These four are different. Hacienda accepts the document, so nothing looks broken, and the filing is wrong. Until each row says otherwise, keep these sales off the connection.
| If you do this | What Sello files today | Keep it off the connection until |
|---|---|---|
Issue a debit note (Odoo's Add debit note, available when the account_debit_note app is installed) on a connection verified before Sello learned to check for that app | A brand-new independent factura, with no reference to the invoice it adjusts. On a connection verified since, it is filed as a Nota de Débito against that invoice | The connection is re-verified from the portal |
| Invoice a customer outside Costa Rica whose Tax ID is a valid, Hacienda-registered Costa Rican identificación | A domestic factura, not a factura de exportación | Factura de Exportación ships |
| Sell through Odoo POS with invoicing turned on | A factura, not a tiquete | Tiquete Electrónico ships |
| Sell to a buyer holding an exoneración | The effective rate recorded on the Odoo line, with no exoneration block — so a line already discounted to 0 % is filed at 0 %, and one left at 13 % is filed at 13 % | Exoneraciones ship |
Sell through Odoo POS with invoicing turned off and nothing is filed at all — no comprobante, and no error, because the sale never becomes an invoice Sello can see.
Two limits on the export row, so it is not read as more than it says. A receptor whose cédula is
missing, malformed or not registered with Hacienda does not reach this case at all — it parks, or
is rejected (-38), which is safe but still not issued. And whether a particular sale legally
requires a factura de exportación is a question for your accountant; Sello does not decide it from
the customer's address, and neither does this page.
Supplier documents are not answered from Odoo
Every business receives them, so this one applies to you.
When a supplier files a comprobante against your cédula, you owe Hacienda a Mensaje Receptor within the first 8 business days of the month after the transaction (MH-DGT-RES-0027-2024, Art. 10). Missing that window puts the IVA crédito fiscal and the renta-deductible gasto at risk. How a late response is treated is a tax question for your accountant, and this page does not answer it.
If you are already late, respond anyway. Sello does not refuse a Mensaje Receptor after the deadline, and an unanswered document is not improved by staying unanswered.
Nobody can fetch them for you, and that includes Sello. Hacienda publishes no API for pulling
the comprobantes other people have filed against your cédula — there is no inbox to poll. A supplier
document reaches Sello only when it is put there, by sending the supplier's signed XML to
POST /v1/received-documents. Sello then stores it, computes the deadline, and lets you respond.
So two things are true at once, and the second is the one that costs money:
- Your Odoo vendor bills are never read. Posting a vendor bill in Odoo answers nothing, and answering from inside Odoo is on the roadmap.
- A supplier document you never ingest is invisible to Sello, and the clock still runs. Sello cannot warn you about a document it was never given. Until you have a route for getting those XMLs in — your supplier emails them, your accountant forwards them, or you post them from a script — the Mensaje Receptor stays a manual obligation and the 8-day window is yours to watch.
Not supported, and the workaround:
| Limit | What to do |
|---|---|
| Tiquete Electrónico, Factura de Exportación and Factura de Compra are not emitted | See the four rows above — three of these file the wrong document rather than parking. A sale to a customer with no cédula is parked, not downgraded to a TE; give the customer a cédula |
| One tax per line | Stacked or compound taxes park the invoice. Split them into separate lines |
| CRC and USD only | Any other currency parks the invoice |
| Receptor is mandatory and must be real | Cédula and email, and the cédula must be registered with Hacienda |
| No exoneraciones | Listed above — it files the wrong document rather than parking. Keep those sales off the connection |
| Emisor identity is never read from Odoo | Change it in Sello |
| Custom Odoo addons | Odoo Online does not allow them. This integration is an external service, by necessity and by design — a bug in it cannot stop you posting invoices |
| About 3 documents a minute | Odoo's own fair-use policy allows one API call per second to your database, and each invoice needs about 19. We stay inside it rather than risk your Odoo account. If you issue hundreds of documents an hour, Odoo Online is the wrong host — talk to us about Odoo.sh |
Troubleshooting
A parked invoice is not retried on its own, and you do not have to duplicate it. The notes below park the invoice, and nothing picks it up again by itself — not correcting the data, and not re-posting the same record, because a job is claimed once per Odoo invoice id. Correct the cause, then press try again on the invoice in the Sello portal: the retry re-reads the record from Odoo, so your correction is what gets filed. Duplicating the invoice also works, but it spends a consecutive number and leaves two records for one sale, so prefer the retry.
| What you see | Cause | Fix, then retry in the portal |
|---|---|---|
| Note: Odoo rechazó la consulta | Odoo answered the read and refused it, and retrying did not clear it — usually a field in the connection's mapping config that no longer exists on the model | Correct the connection (or restore the field), then retry |
| Note: invoice has no billable lines | Every line is a section or a note | Add a real product line |
| Note: missing receptor cédula / email | The customer lacks one or both | Fill both on the contact |
| Note: unmapped tax rate | The tax is not a CR IVA rate, or taxes are stacked | One IVA tax per line |
| Note: unsupported currency | Not CRC or USD | Re-invoice in CRC or USD |
Hacienda -38 | The receptor cédula is not registered with Hacienda | Use a registered cédula |
Hacienda -408 | The economic activity was sent bare instead of in dot format | Use 620100.0 in the mapping config |
Hacienda -37 | Emisor location does not match Hacienda's registry | Advisory only; it does not block acceptance. Align the emisor in Sello to silence it |
AccessError on account.move | The API user lacks Accounting rights | Grant Accounting/Billing user rights — read alone reaches a Hacienda acceptance and then dead-letters on the write-back |
Invalid field x_studio_… | A bound field does not exist | Create it in Studio, or fix the name in the config. The preflight catches this first |
| Nothing lands on the invoice | No public webhook URL, e.g. a local adapter | Normal. The reconcile sweep closes it within its window |
| Accepted, note posted, XML attachment missing | Sello could not serve the artifact while writing back, and settled rather than fail an accepted comprobante | Your operator is alerted automatically. The invoice is valid and Sello holds the signed XML; attaching the Odoo copy is a repair your operator runs on Sello's side (the write-back backfill), not an action in Odoo |
Questions people ask first
Does Sello change my accounting? No. It reads posted documents and writes back attachments, a note, and two optional fields.
What happens if the same invoice is processed twice? Nothing doubles. The consecutive number and the clave are allocated once, and every write-back searches Odoo before it creates anything.
Can I run this on a trial database? For a rehearsal, yes. For live invoicing, no — the trial expires, and the connection dies with it. Provision live connections against a paid Custom-plan database.
Does it slow my Odoo down? Every call for one connection goes through a single queue: one call at a time, spaced by a configured interval, with a shared penalty when Odoo throttles. A batch of invoices cannot open dozens of connections into your database.
What if Odoo is down when a verdict arrives? Sello keeps the verdict and the signed XML, and the write-back retries until Odoo comes back. The document is legally valid either way — it was signed and accepted by Hacienda before any of this, and nothing about the Odoo copy changes that. If an artifact still cannot be fetched after the retries, the invoice keeps its clave and chatter note, the gap is recorded, and your operator is alerted; it does not silently disappear.