Nomenclatura padrão do código de barras

Define barcode nomenclatures to ensure Odoo correctly recognizes and categorizes barcodes. When scanned, a barcode matches the first rule with a matching pattern, based on regular expressions. A barcode is successfully read if its prefix and/or length matches the defined 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.

Nota

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.

Importante

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.

Configuração

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.

Configuração de código de barras ativada com a nomenclatura padrão selecionada.

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:

Nome da regra

Padrão de código de barras

Campo no Odoo

Weighted Barcodes 3 Decimals

(21)….{NNDDD}

Campo Código de barras no formulário do produto

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.

Criar regras

Importante

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.

Campos de definições da página Nomenclatura padrão.

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.

O campo Nome da regra é usado internamente para identificar o que o código de barras representa.

O campo Sequência representa a prioridade da regra; ou seja, quanto menor o valor, mais alta a regra aparece na tabela.

O campo do código de barras Tipo representa diferentes classificações de informações que podem ser compreendidas pelo sistema (por exemplo, Pacote, Lote, Local, Cupom 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.

Depois de preencher as informações, clique no botão Salvar e Novo para salvar a regra e começar imediatamente a criar outra regra. Ou, clique em Salvar e Fechar para salvar a regra e retornar à tabela de regras.

Lista de nomenclatura padrão

A tabela abaixo contém a lista de regras Nomenclatura padrão do Odoo. Os padrões de código de barras são escritos em expressões regulares.

Nome da regra

Tipo

Codificação

Padrão de código de barras

Códigos de barras de preços com 2 casas decimais

Produto precificado

EAN-13

23…..{NNNDD}

Códigos de barras de desconto

Produto com desconto

Qualquer um

22{NN}

Códigos de barras de peso com 3 casas decimais

Produto pesado

EAN-13

21…..{NNDDD}

Códigos de barras de clientes

Cliente

Qualquer um

042

Códigos de barras de cupons e cartões-presente

Cupom

Qualquer um

043|044

Códigos de barras do caixa

Caixa

Qualquer um

041

Códigos de barras de local

Local

Qualquer um

414

Códigos de barras de pacotes

Embalagem

Qualquer um

PACK

Códigos de barras de lote

Lote

Qualquer um

10

Cartão de crédito magnético

Cartão de crédito

Qualquer um

%.*

Códigos de barras do produto

Produto unitário

Qualquer um

.*

Nota

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