lumnik. / scenarios All scenarios · Français

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.

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 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

Limits

This scenario needs lumnik Pro.

See the editions →