All posts
Functional4 min read

Adding Custom Fields to Sale Order Lines in Odoo

Extend Odoo sale order lines with custom fields - using Odoo Studio or technical configuration - to capture customer-specific requirements, specifications, or internal notes per line item.

Custom Fields on Sale Order Lines in Odoo#

Standard sale order lines capture product, quantity, price, and tax. For many businesses, additional per-line data is needed: technical specifications, customer part numbers, delivery notes, or project references. Odoo Studio (or technical development) can add these fields.

Method 1 - Odoo Studio (No Code)#

Settings → Activate Developer Mode → Apps → Studio

Open a sale order → Edit with Studio → click the Order Lines tab → click a column or the + button to add a field:

  1. Field Type: Text (for free-form notes), Integer (for custom quantities), Many2one (for linked records), Date, Selection (dropdown)
  2. Label: "Customer Part Number"
  3. Technical Name: x_customer_part_number
  4. Placed in: Order Lines (sale.order.line model)

The field immediately appears as a column in the order lines table.

Method 2 - Developer Mode (No Studio License)#

In developer mode, you can add fields via the model view:

  1. Settings → Technical → Database Structure → Fields → New
  2. Model: sale.order.line
  3. Field Name: x_spec_notes
  4. Field Type: Text

Add the field to the sale order view via:

Settings → Technical → User Interface → Views → find the sale.order.line tree view → edit the XML to include the new field.

Common Custom Fields for Order Lines#

FieldPurpose
Customer Part NumberMap Odoo product to customer's own part code
Customer PO Line NumberLink each line to the customer's PO reference
Delivery NoteSpecial handling instruction for this line
Project CodeAllocate the line to a specific project for billing
Technical SpecificationFree-text product spec for manufacturing

Printing Custom Fields on Documents#

For custom fields to appear on PDF quotations/orders:

  1. Settings → Technical → Reports → Quotation → edit the QWeb template
  2. Add the field:

Or use Studio's report editor to drag the field onto the PDF template.

Propagating to Delivery and Invoice#

By default, custom sale.order.line fields don't automatically copy to stock.move or account.move.line. If you need the field on delivery or invoice lines:

  • Map the field in the delivery order via an automated action or development
  • Or use analytic distribution to carry context to the invoice

Try ERPeek on your own Odoo module - ask questions, scaffold tests, and explore your codebase in plain language.

Get started free