Odoo read from its PostgreSQL: the product name is a JSON
Goal Read the products of a real Odoo 18 straight from its database and get each product's French name, without writing anything in Odoo.
Since Odoo 16 a translated field is one JSON per row, one key per language. Every report written against the old text column broke. An integrator reading Odoo's database meets it at product_template.name.
- the name lands as JSON text, every language kept
- promote reads the fr_FR key into a column of its own, with en_US as the fallback
- the question in natural language gives the four French names
manifests/10-product-template.yaml
apiVersion: connectors.lumnik.io/v1kind: Connectormetadata: name: scenario-odoo-products-a connector_type: jdbc-generic scopes: [odoo-a]spec: connection: url: jdbc:postgresql://host.docker.internal:55433/scen user: lumnik_reader password_env: SCENARIO_ODOO_A_DB source: tables: - name: product_template schema: public mode: full pk_columns: [id] rename: { id: product_tmpl_id } # id is one of the hub's own columns target: odoo_product_template_a # connector.t_odoo_product_template_a, its own hub table promote: - name: name_fr # the French name, in a column of its own column: name # Odoo 16+: {"en_US": …, "fr_FR": …} path: $.fr_FR fallback: $.en_US # never translated: the English name, as Odoo shows it type: text$ lm apply -f 10-product-template.yaml
Applied connector "scenario-odoo-products-c" — 1 endpoint
$ lm connector run scenario-odoo-products-c
run scheduled: 7cfa1a31-4bde-4e91-854b-4012158d3ab3
$ lm run get 7cfa1a31-4bde-4e91-854b-4012158d3ab3 --wait-evaluated
ID CONNECTOR ENDPOINT STATUS IN OUT SKIPPED DEAD-LETTERS STARTED ENDED EVALUATED
7cfa1a31 scenario-odoo-products-c product_template Completed 4 4 0 0 2026-11-21 18:37 2026-11-21 18:37 yes
$ lm ask --scope odoo-c --lang fr "Liste les produits avec leur référence et leur nom"
Il y a 4 produits listés. Voici les détails :
1. Référence : CHAIR-01, Nom : {"en_US": "Office chair", "fr_FR": "Chaise de bureau"}
2. Référence : DESK-02, Nom : {"en_US": "Standing desk", "fr_FR": "Bureau assis-debout"}
3. Référence : LAMP-03, Nom : {"en_US": "Desk lamp", "fr_FR": "Lampe de bureau"}
4. Référence : CABLE-04, Nom : {"en_US": "USB-C cable"}
data as of: 2026-11-21T17:37:26.245886Z (last completed run)
DEFAULT_CODE NAME
CHAIR-01 {"en_US": "Office chair", "fr_FR": "Chaise de bureau"}
DESK-02 {"en_US": "Standing desk", "fr_FR": "Bureau assis-debout"}
LAMP-03 {"en_US": "Desk lamp", "fr_FR": "Lampe de bureau"}
CABLE-04 {"en_US": "USB-C cable"}
4 rows returned
SQL: SELECT "default_code", "name" FROM (SELECT "product_tmpl_id", "sequence", "categ_id", "uom_id", "uom_po_id", "company_id", "color", "create_uid", "write_uid", "type", "service_tracking", "default_code", "name", "description", "description_purchase", "description_sale", "product_properties", "list_price", "volume", "weight", "sale_ok", "purchase_ok", "active", "can_image_1024_be_zoomed", "has_configurable_attributes", "is_favorite", "create_date", "write_date", "property_account_income_id", "property_account_expense_id", "service_type", "sale_line_warn", "expense_policy", "invoice_policy", "sale_line_warn_msg", "name_fr" FROM connector."t_odoo_product_template_c") AS "t_odoo_product_template_c"
LIMIT 500- scenario-odoo-products-c
- product_template · IN 4 · OUT 4
- CHAIR-01
- {"en_US": "Office chair", "fr_FR": "Chaise de bureau"}
- DESK-02
- {"en_US": "Standing desk", "fr_FR": "Bureau assis-debout"}
- LAMP-03
- {"en_US": "Desk lamp", "fr_FR": "Lampe de bureau"}
- CABLE-04
- {"en_US": "USB-C cable"}
evidence: replay.log, 01-odoo-product-template.txt, 02-names.json, 03-french.json, run-scenario-odoo-products-c.txt · transform v1
$ lm ask --scope odoo-c --lang fr "Quel est le nom français de chaque produit, avec sa référence ?"
Il y a 4 produits. Voici leur nom français et leur référence :
1. Chaise de bureau - CHAIR-01
2. Bureau assis-debout - DESK-02
3. Lampe de bureau - LAMP-03
4. USB-C cable - CABLE-04
data as of: 2026-11-21T17:37:26.245886Z (last completed run)
NAME_FR DEFAULT_CODE
Chaise de bureau CHAIR-01
Bureau assis-debout DESK-02
Lampe de bureau LAMP-03
USB-C cable CABLE-04
4 rows returned
SQL: SELECT "name_fr", "default_code" FROM (SELECT "product_tmpl_id", "sequence", "categ_id", "uom_id", "uom_po_id", "company_id", "color", "create_uid", "write_uid", "type", "service_tracking", "default_code", "name", "description", "description_purchase", "description_sale", "product_properties", "list_price", "volume", "weight", "sale_ok", "purchase_ok", "active", "can_image_1024_be_zoomed", "has_configurable_attributes", "is_favorite", "create_date", "write_date", "property_account_income_id", "property_account_expense_id", "service_type", "sale_line_warn", "expense_policy", "invoice_policy", "sale_line_warn_msg", "name_fr" FROM connector."t_odoo_product_template_c") AS "t_odoo_product_template_c"
LIMIT 500- CHAIR-01
- Chaise de bureau
- DESK-02
- Bureau assis-debout
- LAMP-03
- Lampe de bureau
- CABLE-04
- USB-C cable
evidence: replay.log, 01-odoo-product-template.txt, 02-names.json, 03-french.json, run-scenario-odoo-products-c.txt · transform v1
Limits
- The language is written in the manifest: the hub never picks it from the reader.
- Before icreated/lumnik#2122 the question abstained, and the path was a view in Odoo's database, written by the DBA (data/view.sql).
- Odoo Online does not open its database: it is read through its JSON-2 API (odoo-json2-partners).
- Four synthetic products.
This scenario needs lumnik Pro.
See the editions →