Default barcode nomenclature

Barcode nomenclatures define how barcodes are recognized and categorized. When a barcode is scanned, it is associated to the first rule with a matching pattern. The pattern syntax is described in Odoo’s nomenclature list using a regular expression, and a barcode is successfully read by Odoo if its prefix and/or length matches the one defined in the barcode’s rule.

For instance, at a Point of Sale station, product weight barcodes in the European Article Number (EAN) format, which begin with 21 and have five digits specifying the weight, are used to weigh products and generate a barcode depicting the weight and price. The 21 and five-digit weight is the barcode pattern used to identify the barcode and can be customized to ensure Odoo correctly interprets all barcodes for the business.

Note

Barcodes are also commonly used with Odoo’s Inventory and Barcode apps.

Odoo Barcode supports EAN, Universal Product Code (UPC), and GS1 formats. This document exclusively focuses on default rules and patterns in Odoo, which use UPC and EAN encoding.

Important

To use UPC and EAN barcodes for uniquely identifying products across the entire supply chain, they must be purchased from GS1.

In Odoo, custom barcode patterns can be defined to recognize barcodes specific to the company. Barcodes do not need to be purchased if used only within the company, such as in the example where the barcode is written in the EAN format.

Configuration

To use default nomenclature, navigate to Inventory app ‣ Configuration ‣ Settings. Under the Barcode section, tick the Barcode Scanner checkbox. Doing so installs the Barcode app in the database.

Next, in the Barcode Nomenclature field, ensure Default Nomenclature is selected. Then, click Save.

Enabled barcode setting with Default Nomenclature selected.

With the Barcode module installed, and the Default Nomenclature selected, the barcode actions using UPC and EAN, detailed in the default nomenclature list, are available for use. And, by default, Odoo automatically handles UPC/EAN conversion.

Example: product weight barcode

To better understand how barcode nomenclature is used to identify products in Odoo, this example where product weight barcodes in EAN format are used to allow a Point of Sale business to automatically print barcodes, and calculate the price using the weight of the item.

To set up barcodes for weighted products, the following rule is used:

Rule Name

Barcode Pattern

Field in Odoo

Weighted Barcodes 3 Decimals

(21)….{NNDDD}

Barcode field on product form

Example

To better understand the barcode pattern for weighted products, consider the barcode, 2112345000008:

  • 21: code that identifies this a barcode for weighted products.

  • 12345: five digits (denoted by ..... in the table above) that identify the product.

  • 00000: five digits (denoted by {NNDDD} in the table) representing the weight of the product. On the product form, the five weight values must be 00000. The first two digits are whole number values, and the last three digits are decimal values. For example, “13.5 grams” in the {NNDDD} format is 13500.

  • 8: check digit for 211234500000.

Together, these components make up a 13-character EAN - 13 barcode.

To configure the product barcode for Pasta Bolognese, the EAN barcode for weighted products, 2112345000008, is entered in the Barcode field on the product form (accessible by going to Inventory app ‣ Products ‣ Products, and selecting the desired product). In addition, the Unit of Measure is set to kg.

Barcode field on the product form.

Next, a customer’s bowl of pasta is weighed to be 1.5 kilograms. This generates a new barcode for the pasta, according to the weight: 211234501500, which has a check digit of 2. The new barcode is 2112345015002.

Generated barcode that includes a weight of 1.5 kg.

Ensure the products scan properly, by navigating to the Barcode app ‣ Operations. Next, click any operation type, such as Receipts. Then, click the New button to create a draft stock move. Scan the product weight barcode, such as 2112345015002, and if the intended product appears, the barcode setup is correct.

Show successfully scanned barcode.

Create rules

Important

Adding new rules is necessary for UPC and EAN formats that are not in Odoo’s default list, since barcodes cannot be read successfully if there are unknown fields.

While new rules can be created, Odoo fields do not auto-populate with information from these rules. Custom development is required for this functionality.

To create a rule, first enable developer mode. Then, navigate to Inventory app ‣ Configuration ‣ Barcode Nomenclatures, and select Default Nomenclature.

On this page, configure the following optional fields:

  • UPC/EAN Conversion: determines if a UPC/EAN barcode should be automatically converted when matching a rule with another encoding. Options include Always (the default option), Never, EAN-13 to UPC-A, and UPC-A to EAN-13.

  • Is GS1 Nomenclature: ensure this checkbox is not ticked, as the Default Nomenclature uses UPC and EAN encoding, not GS1 encoding.

Default Nomenclature page setting fields.

On the Default Nomenclature page, click Add a line at the bottom of the table, which opens a Create Rules pop-up window to create a new rule.

The Rule Name field is used internally to identify what the barcode represents.

The Sequence field represents the priority of the rule; meaning the smaller the value, the higher the rule appears on the table.

The barcode Type field represents different classifications of information that can be understood by the system (e.g., Package, Lot, Location, Coupon, etc.).

The Encoding field specifies which encoding the barcode uses. This rule only applies if the barcode uses this specific encoding. The available Encoding options are: EAN-13, EAN-8, UPC-A, and GS1-28.

The Barcode Pattern field represents how the sequence of letters or numbers is recognized by the system to contain information about the product. Sometimes, when a certain amount of digits are required, the number of . is shown. N represents whole number digits, and D represent decimal digits.

Example

1... represents any 4-digit number that starts with 1. NNDD represents a two digit number with two decimal points. For example, 14.25 is 1425.

After filling in the information, click the Save & New button to save the rule, and instantly start creating another rule. Or, click Save & Close to save the rule, and return to the table of rules.

Default nomenclature list

The table below contains Odoo’s list of Default Nomenclature rules. Barcode patterns are written in regular expressions.

Rule Name

Type

Encoding

Barcode Pattern

Price Barcodes 2 Decimals

Priced Product

EAN-13

23…..{NNNDD}

Discount Barcodes

Discounted Product

Any

22{NN}

Weight Barcodes 3 Decimals

Weighted Product

EAN-13

21…..{NNDDD}

Customer Barcodes

Client

Any

042

Coupon & Gift Card Barcodes

Coupon

Any

043|044

Cashier Barcodes

Cashier

Any

041

Location barcodes

Location

Any

414

Package barcodes

Package

Any

PACK

Lot barcodes

Lot

Any

10

Magnetic Credit Card

Credit Card

Any

%.*

Product Barcodes

Unit Product

Any

.*

Note

When the Barcode Pattern contains .*, it means it can contain any number or type of characters.