6 min read•Updated: 2026-11-24

Custom Fields & Odoo Studio Integration

Learn how to create custom fields (x_*) in Odoo via ir.model.fields and inject them safely using XPath validation.

Why Use Custom Fields?

When synchronizing e-commerce orders into Odoo, operations teams frequently require native visibility over storefront metadata directly within Odoo form views, such as:

  • Upstream storefront order numbers (x_zid_order_id, x_salla_order_id).
  • Shipping waybill tracking numbers (x_tracking_number).
  • Custom customer delivery notes.
  • Customer VAT/Tax identification numbers.

ERP Link lets you provision and inject these fields directly into Odoo without requiring Odoo Studio enterprise modules or custom Python code!

Custom Field Creation Interface

To provision a new field in Odoo:

  1. Navigate to Mapping Center > Add Custom Field (/app/mapping-center/add-field).
  2. Select the target Odoo model (e.g., Sales Order sale.order).
  3. Enter the technical field name (prefixed automatically with x_, e.g., x_store_order_number).
  4. Enter the user-facing Field Label.
  5. Choose the data type (Char, Text, Float, Boolean, Selection).
  6. Click Inject Field into Odoo.

Supported Models & Data Types

Custom fields can be injected into core business models:

  • Sales Orders (`sale.order`): For store order numbers, delivery notes, and carrier codes.
  • Customer Invoices (`account.move`): For tax identifiers and payment gateway references.
  • Contacts (`res.partner`): For district names, commercial IDs, and national addresses.
  • Products (`product.template`): For external catalog IDs and metadata.

Available Data Types:

  • char — Short string values (up to 255 characters).
  • text — Multi-line remarks and descriptions.
  • integer / float — Numeric quantities or currency amounts.
  • boolean — Yes/No toggle flags.
  • selection — Predefined dropdown choices.

Security & XML Validation

Our backend enforces rigorous sanitization (src/lib/custom-field-validation.ts):

  • Technical names are strictly regex-validated to prevent injection vulnerabilities.
  • View XML modifications are verified before submitting XPath payloads to Odoo.
  • Collision checks guarantee that existing Odoo core fields are never overwritten.

Encountered an issue applying this guide?

Open a support ticket to have our engineering desk inspect logs directly.

Contact Support
    Custom Fields & Odoo Studio Integration | ERP Link Docs | ErpLink