Skip to content

Odoo 14 Sale Order DB Schema

This is a reference page for the Sale Order domain Database Schema. 90 % of the modules are installed and to keep it simple and clear not all the joint tables are shown.


Odoo 14 Sale Order database schema diagram

Tables

public.account_analytic_tag_sale_order_line_rel
public.account_tax
public.account_tax_sale_order_line_rel
public.delivery_carrier
public.payment_transaction
public.procurement_group
public.product_pricelist
public.product_pricelist_item
public.product_product
public.product_template
public.product_template_attribute_exclusion
public.product_template_attribute_line
public.product_template_attribute_value
public.product_template_attribute_value_sale_order_line_rel
public.res_currency
public.res_partner
public.sale_order
public.sale_order_line
public.sale_order_line_invoice_rel
public.sale_order_transaction_rel
public.stock_warehouse

Table account_analytic_tag_sale_order_line_rel

RELATION BETWEEN sale_order_line AND account_analytic_tag

Idx Field Name Data Type Description
*? ⬈ sale_order_line_id integer
*? ⬈ account_analytic_tag_id integer

Table account_tax

Tax

Idx Field Name Data Type Description
*? ⬋ id integer DEFAULT nextval('account_tax_id_seq'::regclass)
*? name varchar Tax Name
*? type_tax_use varchar Tax Type
? tax_scope varchar Tax Scope
* amount_type varchar Tax Computation
active boolean Active
*? ⬈ company_id integer Company
* sequence integer Sequence
* amount numeric Amount
description varchar Label on Invoices
price_include boolean Included in Price
include_base_amount boolean Affect Base of Subsequent Taxes
analytic boolean Include in Analytic Cost
*⬈ tax_group_id integer Tax Group
tax_exigibility varchar Tax Due
⬈ cash_basis_transition_account_id integer Cash Basis Transition Account
⬈ create_uid integer Created by
create_date timestamp(0) Created on
⬈ write_uid integer Last Updated by
write_date timestamp(0) Last Updated on

Table account_tax_sale_order_line_rel

RELATION BETWEEN sale_order_line AND account_tax

Idx Field Name Data Type Description
*? ⬈ sale_order_line_id integer
*? ⬈ account_tax_id integer

Table delivery_carrier

Shipping Methods

Idx Field Name Data Type Description
*? ⬋ id integer DEFAULT nextval('delivery_carrier_id_seq'::regclass)
* name varchar Delivery Method
active boolean Active
sequence integer Sequence
integration_level varchar Integration Level
prod_environment boolean Environment
debug_logging boolean Debug logging
⬈ company_id integer Company
*⬈ product_id integer Delivery Product
* invoice_policy varchar Invoicing Policy
zip_from varchar Zip From
zip_to varchar Zip To
margin float8 Margin
free_over boolean Free if order amount is above
amount float8 Amount
return_label_on_delivery boolean Generate Return Label
get_return_label_from_portal boolean Return Label Accessible from Customer Portal
fixed_price float8 Fixed Price
* delivery_type varchar Provider
⬈ create_uid integer Created by
create_date timestamp(0) Created on
⬈ write_uid integer Last Updated by
write_date timestamp(0) Last Updated on
? ⬈ website_id integer Website
? is_published boolean Is Published

Table payment_transaction

Payment Transaction

Idx Field Name Data Type Description
*? ⬋ id integer DEFAULT nextval('payment_transaction_id_seq'::regclass)
date timestamp(0) Validation Date
*⬈ acquirer_id integer Acquirer
* type varchar Type
* state varchar Status
state_message text Message
* amount numeric Amount
fees numeric Fees
*⬈ currency_id integer Currency
*? reference varchar Reference
acquirer_reference varchar Acquirer Reference
⬈ partner_id integer Customer
partner_name varchar Partner Name
partner_lang varchar Language
partner_email varchar Email
partner_zip varchar Zip
partner_address varchar Address
partner_city varchar City
*⬈ partner_country_id integer Country
partner_phone varchar Phone
html_3ds varchar 3D Secure HTML
⬈ callback_model_id integer Callback Document Model
callback_res_id integer Callback Document ID
callback_method varchar Callback Method
callback_hash varchar Callback Hash
return_url varchar Return URL after payment
is_processed boolean Has the payment been post processed
⬈ payment_token_id integer Payment Token
⬈ payment_id integer Payment
⬈ create_uid integer Created by
create_date timestamp(0) Created on
⬈ write_uid integer Last Updated by
write_date timestamp(0) Last Updated on
stripe_payment_intent varchar Stripe Payment Intent ID
stripe_payment_intent_secret varchar Stripe Payment Intent Secret

Table procurement_group

Procurement Group

Idx Field Name Data Type Description
*? ⬋ id integer DEFAULT nextval('procurement_group_id_seq'::regclass)
⬈ partner_id integer Partner
* name varchar Reference
* move_type varchar Delivery Type
⬈ create_uid integer Created by
create_date timestamp(0) Created on
⬈ write_uid integer Last Updated by
write_date timestamp(0) Last Updated on
⬈ sale_id integer Sale Order

Table product_pricelist

Pricelist

Idx Field Name Data Type Description
*? ⬋ id integer DEFAULT nextval('product_pricelist_id_seq'::regclass)
* name varchar Pricelist Name
active boolean Active
*⬈ currency_id integer Currency
⬈ company_id integer Company
sequence integer Sequence
* discount_policy varchar Discount Policy
⬈ create_uid integer Created by
create_date timestamp(0) Created on
⬈ write_uid integer Last Updated by
write_date timestamp(0) Last Updated on
⬈ website_id integer Website
code varchar E-commerce Promotional Code
selectable boolean Selectable

Table product_pricelist_item

Pricelist Rule

Idx Field Name Data Type Description
*? id integer DEFAULT nextval('product_pricelist_item_id_seq'::regclass)
⬈ product_tmpl_id integer Product
⬈ product_id integer Product Variant
⬈ categ_id integer Product Category
min_quantity numeric Min. Quantity
* applied_on varchar Apply On
* base varchar Based on
⬈ base_pricelist_id integer Other Pricelist
*? ⬈ pricelist_id integer Pricelist
price_surcharge numeric Price Surcharge
price_discount numeric Price Discount
price_round numeric Price Rounding
price_min_margin numeric Min. Price Margin
price_max_margin numeric Max. Price Margin
⬈ company_id integer Company
⬈ currency_id integer Currency
active boolean Active
date_start timestamp(0) Start Date
date_end timestamp(0) End Date
*? compute_price varchar Compute Price
fixed_price numeric Fixed Price
percent_price float8 Percentage Price
⬈ create_uid integer Created by
create_date timestamp(0) Created on
⬈ write_uid integer Last Updated by
write_date timestamp(0) Last Updated on

Table product_product

Product

Idx Field Name Data Type Description
*? ⬋ id integer DEFAULT nextval('product_product_id_seq'::regclass)
? ⬈ message_main_attachment_id integer Main Attachment
? default_code varchar Internal Reference
active boolean Active
*? ⬈ product_tmpl_id integer Product Template
? barcode varchar Barcode
? combination_indices varchar Combination Indices
volume numeric Volume
weight numeric Weight
can_image_variant_1024_be_zoomed boolean Can Variant Image 1024 be zoomed
⬈ create_uid integer Created by
create_date timestamp(0) Created on
⬈ write_uid integer Last Updated by
write_date timestamp(0) Last Updated on

Table product_template

Product Template

Idx Field Name Data Type Description
*? ⬋ id integer DEFAULT nextval('product_template_id_seq'::regclass)
? ⬈ message_main_attachment_id integer Main Attachment
*? name varchar Name
sequence integer Sequence
description text Description
description_purchase text Purchase Description
description_sale text Sales Description
* type varchar Product Type
*⬈ categ_id integer Product Category
list_price numeric Sales Price
volume numeric Volume
weight numeric Weight
sale_ok boolean Can be Sold
purchase_ok boolean Can be Purchased
*⬈ uom_id integer Unit of Measure
*⬈ uom_po_id integer Purchase Unit of Measure
? ⬈ company_id integer Company
active boolean Active
color integer Color Index
default_code varchar Internal Reference
can_image_1024_be_zoomed boolean Can Image 1024 be zoomed
has_configurable_attributes boolean Is a configurable product
⬈ create_uid integer Created by
create_date timestamp(0) Created on
⬈ write_uid integer Last Updated by
write_date timestamp(0) Last Updated on
service_type varchar Track Service
* sale_line_warn varchar Sales Order Line
sale_line_warn_msg text Message for Sales Order Line
expense_policy varchar Re-Invoice Expenses
invoice_policy varchar Invoicing Policy
rating_last_value float8 Rating Last Value
website_meta_title varchar Website meta title
website_meta_description text Website meta description
website_meta_keywords varchar Website meta keywords
website_meta_og_img varchar Website opengraph image
seo_name varchar Seo name
? ⬈ website_id integer Website
? is_published boolean Is Published
website_description text Description for the website
website_size_x integer Size X
website_size_y integer Size Y
⬈ website_ribbon_id integer Ribbon
website_sequence integer Website Sequence
sale_delay float8 Customer Lead Time
* tracking varchar Tracking
description_picking text Description on Picking
description_pickingout text Description on Delivery Orders
description_pickingin text Description on Receptions
inventory_availability varchar Inventory Availability
available_threshold float8 Availability Threshold
custom_message text Custom Message
available_in_pos boolean Available in POS
to_weight boolean To Weigh With Scale
⬈ pos_categ_id integer Point of Sale Category
event_ok boolean Is an Event Ticket
hs_code varchar HS Code
purchase_method varchar Control Policy
* purchase_line_warn varchar Purchase Order Line Warning
purchase_line_warn_msg text Message for Purchase Order Line
service_to_purchase boolean Purchase Automatically
service_tracking varchar Service Tracking

Table product_template_attribute_exclusion

Product Template Attribute Exclusion

Idx Field Name Data Type Description
*? ⬋ id integer DEFAULT nextval('product_template_attribute_exclusion_id_seq'::regclass)
? ⬈ product_template_attribute_value_id integer Attribute Value
*? ⬈ product_tmpl_id integer Product Template
⬈ create_uid integer Created by
create_date timestamp(0) Created on
⬈ write_uid integer Last Updated by
write_date timestamp(0) Last Updated on

Table product_template_attribute_line

Product Template Attribute Line

Idx Field Name Data Type Description
*? ⬋ id integer DEFAULT nextval('product_template_attribute_line_id_seq'::regclass)
active boolean Active
*? ⬈ product_tmpl_id integer Product Template
*? ⬈ attribute_id integer Attribute
⬈ create_uid integer Created by
create_date timestamp(0) Created on
⬈ write_uid integer Last Updated by
write_date timestamp(0) Last Updated on

Table product_template_attribute_value

Product Template Attribute Value

Idx Field Name Data Type Description
*? ⬋ id integer DEFAULT nextval('product_template_attribute_value_id_seq'::regclass)
ptav_active boolean Active
*? ⬈ product_attribute_value_id integer Attribute Value
*? ⬈ attribute_line_id integer Attribute Line
price_extra numeric Value Price Extra
? ⬈ product_tmpl_id integer Product Template
? ⬈ attribute_id integer Attribute
⬈ create_uid integer Created by
create_date timestamp(0) Created on
⬈ write_uid integer Last Updated by
write_date timestamp(0) Last Updated on

Table product_template_attribute_value_sale_order_line_rel

RELATION BETWEEN sale_order_line AND product_template_attribute_value

Idx Field Name Data Type Description
*? ⬈ sale_order_line_id integer
*? ⬈ product_template_attribute_value_id integer

Table res_currency

Idx Field Name Data Type Description
*? ⬋ id integer DEFAULT nextval('res_currency_id_seq'::regclass)
*? name varchar
* symbol varchar
rounding numeric Rounding Factor
decimal_places integer Decimal Places
active boolean Active
position varchar Symbol Position
currency_unit_label varchar Currency Unit
currency_subunit_label varchar Currency Subunit
⬈ create_uid integer Created by
create_date timestamp(0) Created on
⬈ write_uid integer Last Updated by
write_date timestamp(0) Last Updated on

Table res_partner

Idx Field Name Data Type Description
*? ⬋ id integer DEFAULT nextval('res_partner_id_seq'::regclass)
? name varchar
? ⬈ company_id integer
create_date timestamp(0)
? display_name varchar Display Name
? date date Date
⬈ title integer Title
? ⬈ parent_id integer Related Company
? ref varchar Reference
lang varchar Language
tz varchar Timezone
⬈ user_id integer Salesperson
? vat varchar Tax ID
website varchar Website Link
comment text Notes
credit_limit float8 Credit Limit
active boolean Active
employee boolean Employee
function varchar Job Position
type varchar Address Type
street varchar Street
street2 varchar Street2
zip varchar Zip
city varchar City
⬈ state_id integer State
⬈ country_id integer Country
partner_latitude numeric Geo Latitude
partner_longitude numeric Geo Longitude
email varchar Email
phone varchar Phone
mobile varchar Mobile
is_company boolean Is a Company
⬈ industry_id integer Industry
color integer Color Index
partner_share boolean Share Partner
? ⬈ commercial_partner_id integer Commercial Entity
commercial_company_name varchar Company Name Entity
company_name varchar Company Name
⬈ create_uid integer Created by
⬈ write_uid integer Last Updated by
write_date timestamp(0) Last Updated on
? ⬈ message_main_attachment_id integer Main Attachment
email_normalized varchar Normalized Email
message_bounce integer Bounce
signup_token varchar Signup Token
signup_type varchar Signup Token Type
signup_expiration timestamp(0) Signup Expiration
⬈ team_id integer Sales Team
partner_gid integer Company database ID
additional_info varchar Additional info
phone_sanitized varchar Sanitized Number
debit_limit numeric Payable Limit
last_time_entries_checked timestamp(0) Latest Invoices & Payments Matching Date
invoice_warn varchar Invoice
invoice_warn_msg text Message for Invoice
supplier_rank integer Supplier Rank
customer_rank integer Customer Rank
? ⬈ website_id integer Website
? is_published boolean Is Published
sale_warn varchar Sales Warnings
sale_warn_msg text Message for Sales Order
picking_warn varchar Stock Picking
picking_warn_msg text Message for Stock Picking
calendar_last_notif_ack timestamp(0) Last notification marked as read from base Calendar
purchase_warn varchar Purchase Order
purchase_warn_msg text Message for Purchase Order
website_meta_title varchar Website meta title
website_meta_description text Website meta description
website_meta_keywords varchar Website meta keywords
website_meta_og_img varchar Website opengraph image
seo_name varchar Seo name
website_description text Website Partner Full Description
website_short_description text Website Partner Short Description

Table sale_order

Sales Order

Idx Field Name Data Type Description
*? ⬋ id integer DEFAULT nextval('sale_order_id_seq'::regclass)
⬈ campaign_id integer Campaign
⬈ source_id integer Source
⬈ medium_id integer Medium
? ⬈ message_main_attachment_id integer Main Attachment
access_token varchar Security Token
*? name varchar Order Reference
origin varchar Source Document
client_order_ref varchar Customer Reference
reference varchar Payment Ref.
? state varchar Status
*? date_order timestamp(0) Order Date
validity_date date Expiration
require_signature boolean Online Signature
require_payment boolean Online Payment
? create_date timestamp(0) Creation Date
? ⬈ user_id integer Salesperson
*? ⬈ partner_id integer Customer
*⬈ partner_invoice_id integer Invoice Address
*⬈ partner_shipping_id integer Delivery Address
*⬈ pricelist_id integer Pricelist
⬈ currency_id integer Currency
⬈ analytic_account_id integer Analytic Account
invoice_status varchar Invoice Status
note text Terms and conditions
amount_untaxed numeric Untaxed Amount
amount_tax numeric Taxes
amount_total numeric Total
currency_rate numeric Currency Rate
⬈ payment_term_id integer Payment Terms
⬈ fiscal_position_id integer Fiscal Position
*? ⬈ company_id integer Company
⬈ team_id integer Sales Team
signed_by varchar Signed By
signed_on timestamp(0) Signed On
commitment_date timestamp(0) Delivery Date
show_update_pricelist boolean Has Pricelist Changed
⬈ create_uid integer Created by
⬈ write_uid integer Last Updated by
write_date timestamp(0) Last Updated on
cart_recovery_email_sent boolean Cart recovery email already sent
⬈ website_id integer Website
⬈ incoterm integer Incoterm
* picking_policy varchar Shipping Policy
*⬈ warehouse_id integer Warehouse
⬈ procurement_group_id integer Procurement Group
effective_date date Effective Date
warning_stock varchar Warning
⬈ sale_order_template_id integer Quotation Template
⬈ carrier_id integer Delivery Method
delivery_message varchar Delivery Message
delivery_rating_success boolean Delivery Rating Success
recompute_delivery_price boolean Delivery cost should be recomputed
amount_delivery numeric Delivery Amount
⬈ opportunity_id integer Opportunity
⬈ code_promo_program_id integer Applied Promo Program
margin numeric Margin
margin_percent float8 Margin (%)
⬈ project_id integer Project

Table sale_order_line

Sales Order Line

Idx Field Name Data Type Description
*? ⬋ id integer DEFAULT nextval('sale_order_line_id_seq'::regclass)
*? ⬈ order_id integer Order Reference
* name text Description
sequence integer Sequence
invoice_status varchar Invoice Status
* price_unit numeric Unit Price
price_subtotal numeric Subtotal
price_tax float8 Total Tax
price_total numeric Total
price_reduce numeric Price Reduce
price_reduce_taxinc numeric Price Reduce Tax inc
price_reduce_taxexcl numeric Price Reduce Tax excl
discount numeric Discount (%)
⬈ product_id integer Product
* product_uom_qty numeric Quantity
⬈ product_uom integer Unit of Measure
qty_delivered_method varchar Method to update delivered qty
qty_delivered numeric Delivered Quantity
qty_delivered_manual numeric Delivered Manually
qty_to_invoice numeric To Invoice Quantity
qty_invoiced numeric Invoiced Quantity
untaxed_amount_invoiced numeric Untaxed Invoiced Amount
untaxed_amount_to_invoice numeric Untaxed Amount To Invoice
⬈ salesman_id integer Salesperson
⬈ currency_id integer Currency
? ⬈ company_id integer Company
⬈ order_partner_id integer Customer
is_expense boolean Is expense
is_downpayment boolean Is a down payment
state varchar Order Status
* customer_lead float8 Lead Time
display_type varchar Display Type
⬈ create_uid integer Created by
create_date timestamp(0) Created on
⬈ write_uid integer Last Updated by
write_date timestamp(0) Last Updated on
⬈ linked_line_id integer Linked Order Line
⬈ product_packaging integer Package
⬈ route_id integer Route
warning_stock varchar Warning
⬈ event_id integer Event
⬈ event_ticket_id integer Event Ticket
is_delivery boolean Is a Delivery
is_reward_line boolean Is a program reward line
margin numeric Margin
margin_percent float8 Margin (%)
purchase_price numeric Cost
? ⬈ project_id integer Generated Project
? ⬈ task_id integer Generated Task
is_service boolean Is a Service

Table sale_order_line_invoice_rel

RELATION BETWEEN account_move_line AND sale_order_line

Idx Field Name Data Type Description
*? ⬈ invoice_line_id integer
*? ⬈ order_line_id integer

Table sale_order_transaction_rel

RELATION BETWEEN sale_order AND payment_transaction

Idx Field Name Data Type Description
*? ⬈ sale_order_id integer
*? ⬈ transaction_id integer

Table stock_warehouse

Warehouse

Idx Field Name Data Type Description
*? ⬋ id integer DEFAULT nextval('stock_warehouse_id_seq'::regclass)
*? name varchar Warehouse
active boolean Active
*? ⬈ company_id integer Company
⬈ partner_id integer Address
*⬈ view_location_id integer View Location
*⬈ lot_stock_id integer Location Stock
*? code varchar(5) Short Name
* reception_steps varchar Incoming Shipments
* delivery_steps varchar Outgoing Shipments
⬈ wh_input_stock_loc_id integer Input Location
⬈ wh_qc_stock_loc_id integer Quality Control Location
⬈ wh_output_stock_loc_id integer Output Location
⬈ wh_pack_stock_loc_id integer Packing Location
⬈ mto_pull_id integer MTO rule
⬈ pick_type_id integer Pick Type
⬈ pack_type_id integer Pack Type
⬈ out_type_id integer Out Type
⬈ in_type_id integer In Type
⬈ int_type_id integer Internal Type
⬈ crossdock_route_id integer Crossdock Route
⬈ reception_route_id integer Receipt Route
⬈ delivery_route_id integer Delivery Route
sequence integer Sequence
⬈ create_uid integer Created by
create_date timestamp(0) Created on
⬈ write_uid integer Last Updated by
write_date timestamp(0) Last Updated on
⬈ pos_type_id integer Point of Sale Operation Type
buy_to_resupply boolean Buy to Resupply
⬈ buy_pull_id integer Buy rule