During label design in ZPL Label Designer, fields are displayed in the General View by default.
You can right-click a field and change its display type to Barcode, QR Code, or GS1 Barcode.
GS1 Barcode allows multiple values, such as a product GTIN, lot number, serial number, expiration date, and quantity, to be encoded into a single barcode. This can simplify warehouse operations by reducing the number of scans required during receiving, internal transfers, and inventory adjustments.
This article explains how to configure GS1 barcodes in ZPL Label Designer and describes the formatting requirements that must be followed.
Enable GS1 Barcode Display
To create a GS1 barcode in ZPL Label Designer:
-
Add a field to the label.
-
Configure the field value using the required Odoo fields and the GS1 format described below.
-
Right-click the field.
-
In Settings, select GS1 Barcode as the display type.
Understanding GS1 Application Identifiers
GS1 barcodes are built using Application Identifiers (AIs). Each AI defines the meaning of the data that follows it.
Some of the most commonly used Application Identifiers in Odoo environments are shown below.
|
AI |
Description |
Typical Odoo Field |
|---|---|---|
|
01 |
GTIN |
Product Barcode |
|
10 |
Batch / Lot Number |
Lot Number |
|
17 |
Expiration Date |
Expiration Date |
|
21 |
Serial Number |
Serial Number |
|
30 |
Quantity |
Quantity |
The AI codes above are only examples of commonly used identifiers. GS1 supports many additional Application Identifiers that can be combined depending on your business requirements.
For a complete list of Application Identifiers and their requirements, refer to the official GS1 Application Identifier documentation:
https://ref.gs1.org/ai/?lang=en
Building a GS1 Barcode
In ZPL Label Designer, each Application Identifier must be prefixed with _1.
The _1 separator indicates that a new GS1 field begins. Without this separator, the barcode may not be encoded correctly.
The example below demonstrates one of the most common GS1 barcode configurations used in Odoo environments. It combines a product GTIN, serial number, and expiration date.
Your GS1 barcode structure may be different depending on your business requirements. You can combine other Application Identifiers and fields as needed.
_101%%product_id.barcode%%_121%%name%%_117%%expiration_date%%
In this example:
-
_101identifies the GTIN (Product Barcode). -
_121identifies the Serial Number. -
_117identifies the Expiration Date.
When using these Application Identifiers, keep the following requirements in mind:
-
GTIN (01) must contain a valid 14-digit GTIN.
-
Serial Number (21) can contain up to 20 characters.
-
Expiration Date (17) must be encoded in
YYMMDDformat.
Date Field Formatting in Odoo
If you use an Odoo date or datetime field, you must format it before including it in a GS1 barcode.
For example:
<t t-out="doc.expiration_date" t-options="{'widget': 'datetime', 'format': 'yyMMdd'}"/>
Without this formatting, Odoo may return the date in a different format, and the GS1 barcode may not be decoded correctly.
The following example shows a complete GS1 barcode definition in a QWeb label template:
^FD_101<t t-esc="doc.product_id.barcode"/>_121<t t-esc="doc.name"/>_117<t t-esc="doc.expiration_date" t-options="{'widget': 'datetime', 'format': 'yyMMdd'}"/>^FS
Verification
After generating the label:
-
Print a test label.
-
Scan the GS1 barcode using a GS1-compatible scanner.
-
Verify that all values are decoded correctly.