Chapter 8 Barcode Rules
Odoo supports barcode scanning for products, serial numbers, lots, packages, and warehouse operations. To decide how a scanned code should be interpreted, Odoo uses a dedicated object: barcode nomenclature and barcode rules.
This chapter introduces the basic barcode standards and explains how Odoo barcode rules identify different code patterns.
UPC And EAN
Two common barcode systems are UPC and EAN.
UPC, or Universal Product Code, is mainly used in the United States and Canada. It is commonly a 12-digit barcode. EAN, or European Article Number, is used in many other regions. The standard 13-digit version is called EAN-13, and the shorter 8-digit version is EAN-8.

UPC and EAN can be converted. A UPC can become an EAN by adding 0 at the beginning.
GS1 Standard
GS1 provides a common global language for businesses to uniquely identify, capture, and share information about products, locations, logistics units, assets, documents, and service relationships.
Common GS1 identifiers include:
| GS1 Identifier | Identifies | Example |
|---|---|---|
| GTIN | Trade items | Clothes sold online, cakes sold in a store |
| GLN | Partners and locations | Company, warehouse, factory, store |
| SSCC | Logistics units | Pallet, container, parcel |
| GRAI | Returnable assets | Pallet base, crate, container |
| GIAI | Individual assets | Medical equipment, production equipment |
| GSRN | Service relationship | Loyalty member, patient, employee |
| GDTI | Document type | Tax document, shipping document, insurance policy |
| GINC | Consignment | A group of logistics units in a shipment |
| GSIN | Shipment | Logistics units shipped under the same dispatch notice |
| GCN | Coupon | Physical or digital coupon |
| CPID | Component or part | Component that becomes part of a final product |
In warehouse implementation, GS1 is important when products, lots, expiration dates, weights, or logistics units need to be encoded in one scannable string.
Barcode Nomenclature
After understanding UPC and EAN, we can look at Odoo barcode rules. A typical barcode nomenclature looks like this:

Important properties include:
| Field | Meaning |
|---|---|
| Barcode Nomenclature | The name of the barcode rule set |
| UPC/EAN Conversion | How Odoo converts between UPC and EAN |
| Use GS1 Nomenclature | If enabled, the nomenclature accepts GS1-128 style codes |
UPC/EAN conversion options include always, EAN-13 to UPC-A, UPC-A to EAN-13, and never.
Barcode rules define how barcodes are organized and recognized. When a barcode is scanned, Odoo uses the first matching rule. Rules are based on patterns. If a pattern matches the scanned barcode prefix, that rule is applied.
Patterns can also define numeric value positions. For example, product price or weight can be encoded in the barcode. {N} represents numeric digits, and {D} supports decimal precision. {NNNDD} means three integer digits and two decimal digits.
Rule Definition
Opening a barcode rule shows a form like this:

Common fields include:
- Rule name.
- Sequence, which controls matching order.
- Type, which defines the scanning scenario supported by Odoo.
- Encoding.
- Pattern, which defines the regular expression matching logic.
Rule sequence is important. If two rules can match the same barcode, the earlier rule wins. During implementation, barcode rules should be tested with real scanner output, not only with theoretical examples.
This chapter explained barcode standards and Odoo barcode rules. The next chapter explains putaway rules, which decide where incoming products should be stored.