Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Odoo JSON-RPC connector for EasyCatalog

A read-only, reusable EasyCatalog Custom Data Provider that pulls any Odoo model straight into Adobe InDesign — no Excel or CSV export in between.

It reads through Odoo's execute_kw / search_read external API and pages automatically until the full result set has been retrieved. Point it at a model, list the fields you need, and EasyCatalog treats Odoo as just another data source.

What it does

  • Works with any Odoo model (product.product, product.template, res.partner, …)
  • Automatic pagination through offset / limit, so large catalogues come across completely
  • Domains, ordering and context are configurable, using normal Odoo syntax
  • Many2one relations resolve to readable labels, raw IDs, or JSON — your choice
  • Lists flatten to line breaks, comma-separated values, or JSON
  • Field aliases rename Odoo fields to the names your InDesign template already expects
  • Image URL fields are handed to EasyCatalog as downloadable assets

Requirements

  • EasyCatalog with the Enterprise Data Provider module
  • An Odoo user with External API access and read permission on the model and fields you request
  • The numeric Odoo user ID, or the user's login so the connector can authenticate it
  • An API key (recommended) or password

On Odoo Online the external API needs the Custom plan. It is not available on One App Free or Standard. For Odoo.sh, on-premise and Community installations, confirm that /jsonrpc is reachable from outside and that the installation allows web service calls. Check this first — everything else depends on it.

Installation

Copy Odoo JSON-RPC.lua into your EasyCatalog data provider folder and restart InDesign. Odoo JSON-RPC then appears as a data source type.

Leave the file where you registered it. EasyCatalog remembers the path, so moving or renaming the script afterwards breaks the info button on the Manage Enterprise Data Providers dialog.

Setting up Odoo access

Create an API key

Odoo accepts an API key anywhere it would otherwise take a password. Use one rather than a personal password.

  1. Sign in as the user the integration should run as.
  2. Open Preferences (or My Profile).
  3. Go to the Account Security tab.
  4. Choose New API Key.
  5. Give it a recognisable description, for example EasyCatalog production.
  6. Choose Generate Key and copy it somewhere safe straight away.

Odoo shows a generated key once. If you lose it, create a new one and revoke the old.

Give it the right permissions

Use a dedicated integration user, for example easycatalog-api@example.com, and keep it narrow:

  • Read on the models and fields you request
  • Access limited to the companies whose data may be exported
  • No Write, Create or Delete unless something else needs them
  • No administrator or superuser rights

The connector only ever calls search_read, but a leaked API key carries every right of the user it belongs to. The limits that count are the ones set in Odoo.

Check while signed in as that exact user: how many records are visible, whether every requested field is readable, whether multi-company rules show the right records, and whether archived records should be included.

Find the user ID

Fill in Login and leave User ID blank, and the connector looks the ID up for you. Filling in the numeric User ID instead saves one round trip per sync — you will find it in Odoo under Settings → Users, in the URL of the user's form view.

Configuration

Field Required Notes
Name yes Name of the data source in EasyCatalog
JSON-RPC URL yes Full endpoint, ending in /jsonrpc. HTTPS is enforced for remote hosts
Database yes Odoo database name
User ID either Numeric ID. Faster: skips the authentication call
Login either Used to look the user ID up when User ID is blank
API key / password yes An API key is strongly preferred over a password
Model yes e.g. product.product
Unique key field yes Must be unique across all records, e.g. id or default_code
Fields no Comma-separated. See the warning below before leaving this empty
Domain no Odoo domain as a JSON array, e.g. [["active", "=", true]]
Order no e.g. id asc
Context no JSON object, e.g. {"lang": "nl_BE"}
Page size no Records per request, 1–10000. Default 500
Aliases no source=target, comma-separated
Many2one fields no Display value (default), ID, or JSON
Other arrays no Line breaks (default), Comma separated, or JSON
Image URL fields no Fields holding an image URL. See the warning below

Use the Test button before clicking OK. A test requests a single record, so it confirms the connection without pulling the whole catalogue.

Example

A product export keyed on the internal reference, with brand names resolved to labels:

Setting Value
JSON-RPC URL https://odoo.example.com/jsonrpc
Database example-v18
User ID 2
Model product.product
Unique key field default_code
Fields default_code, name, barcode, weight, product_brand_id, categ_id
Domain [["active", "=", true]]
Order id asc
Aliases product_brand_id=product_brand
Many2one fields Display value

product_brand_id and categ_id arrive as readable labels rather than IDs, and product_brand_id is renamed to product_brand so an existing template keeps working.

Things worth knowing

"Image URL fields" means URL fields, not Odoo image fields. Odoo's own binary image fields (image_1920, image_128, …) return base64 data, not a URL. Pointing this setting at one of them gives EasyCatalog something it cannot download. Use a field that genuinely contains a URL — often a custom field populated by a PIM or a CDN. An empty (false) image field becomes an empty value, so EasyCatalog will not try to fetch false as a URL.

Leave Fields empty only on purpose. Odoo then returns every readable field on the model, including base64 binaries. On a large catalogue that turns into a download of hundreds of megabytes. A specific field list is faster, smaller and safer.

Booleans arrive as text. A false from Odoo becomes the string false, which keeps output close to a JSON or XML source. The one exception is a configured image URL field, which becomes empty instead.

The key field must be genuinely unique. The connector stops with an error on a duplicate or empty key rather than silently dropping records. If you key on a many2one with Display value, two records sharing a label will collide — key on id or a code field instead.

The connector is read-only. Edits made in EasyCatalog are acknowledged locally and never written back to Odoo.

Security

EasyCatalog stores the settings you enter, including the API key, in the data source configuration it creates. Do not share or publish a configured data source. Give each integration its own Odoo API key with read-only rights, so you can revoke it without touching anything else.

Odoo version compatibility

Built and tested against Odoo 18's external /jsonrpc API.

Odoo has announced the newer JSON-2 API for Odoo 19, and plans to remove the external XML-RPC/JSON-RPC endpoints in Odoo 22 and Odoo Online 21.1. Those releases will need a JSON-2 transport; the configuration model in this connector is designed to carry over.

About

Built by Dieter Devlaeminck. I help companies automate catalogues, price lists and technical sheets in InDesign with EasyCatalog — from data source to finished publication.

Questions, bugs or a model that will not cooperate? Open an issue.

License

MIT — see LICENSE. Use it, change it, ship it.

About

Read-only EasyCatalog Custom Data Provider that pulls any Odoo model straight into Adobe InDesign over Odoo's JSON-RPC external API. Automatic pagination, domains, ordering, field aliases, many2one labels and image URLs, no Excel or CSV export in between.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages