Barcodes in Dolibarr
The Dolibarr Barcode module tested end to end on 24.0.3: the forgotten generator setting, the default mask that creates codes a barcode scanner never finds, label sheets, scanning in TakePOS (including scale labels) and inventory by scanning.
Want someone to look at your instance? Diagnosis, fixed price €90.
What was checked (versions, tests, code read)
Tests on 14/11/2026 on a fresh Dolibarr 24.0.3 install, in the interface (browser driven with real clicks): module activation, generator choice, 23 codes typed in (valid, wrong check digit, 12 digits, letters, duplicate, Code 128, mask control), automatic numbering with the default mask and with a check-digit mask, mass generation, an Avery L7163 label sheet, TakePOS scans (scanner simulated: fast typing then Enter) with and without the 'Merge lines of the same products' and 'Enter key code' settings, the scale label rule, inventory by scanning, the shipping PDF. Every label produced was read back by an EAN13 decoder, as a scanner would. English labels and messages checked on the same install switched to English. Not tested: third-party barcodes, scanning at supplier reception, lots and serial numbers, Multicompany, a real USB scanner (simulated with the keyboard).
Dolibarr handles barcodes without any external module: one code per product, label sheets, scanning at the point of sale (TakePOS) and during inventory. A barcode scanner behaves like a keyboard: it types the code very fast, then Enter. There is nothing to install.
This guide follows the whole path on a fresh Dolibarr 24.0.3 install, tested on 14 November 2026. Every label produced was read back by a decoder, as a scanner would: that is how the most annoying trap showed up, the one in the default mask.
In short
- Enable the module, then choose a generator (TCPDF-barcode) for each type you use. After activation, no type has one, and no barcode is displayed.
- Don’t keep the default mask.
04{0000000000}creates 12-digit codes; the label shows 13 and the scanner never finds the product. Use a 13-character mask ending with*, for example210{000000000}*. - Dolibarr does not check the check digit of an EAN13 typed by hand: a wrong code, or one with letters, is saved without any message, and nothing is drawn instead of the barcode.
- At the till, set the TakePOS terminal to “13” for the Enter key: without it, an unknown code stays in the field and the next scan is appended to it.
1. Enable the module and choose a generator
Home › Setup › Modules/Applications, module Barcodes, then the gear icon to open its setup (“Barcode setup”).
Right after activation, the “Barcode encoding type” table shows “No generator defined” for all eight types (Code 128, Code 39, Datamatrix, EAN13, EAN8, ISBN, Qr Code, UPC), and the “Default barcode type to use for products” list offers nothing. As long as this is the case, no barcode is drawn.
In the Barcode generator column, choose TCPDF-barcode for each type you need (saved as soon as you pick it). According to the code, the “Internal engine” only draws EAN13, ISBN and UPC without an external tool; TCPDF-barcode covers every type in the list. Then choose the default type at the bottom of the page (EAN13 in our test) and click Modify. Only types that have a generator appear in that list.

2. A barcode on the product card
With the module enabled, the product card gets two fields: Barcode type and Barcode value. We typed several codes to see what Dolibarr accepts (no numbering manager enabled yet):
| Code typed (EAN13 type) | Saved? | What is displayed | Found when scanning the label? |
|---|---|---|---|
2000000000015 (13 digits, correct check digit) |
yes | the barcode | yes |
2000000000016 (wrong check digit) |
yes, no message | nothing (empty image) | — |
ABC123 (letters) |
yes, no message | nothing (empty image) | — |
200000000003 (12 digits) |
yes | a 13-digit barcode: 2000000000039 |
no |
2000000000015 on a 2nd product |
refused: “The product barcode 2000000000015 already exists on another product reference.” | — | — |
Two lessons:
- The same code cannot be used by two products (Dolibarr refuses it, and the database forbids it).
A product has a single barcode field: the unit and the carton of 12 are therefore two different
products. We did it with a Code 128 for the carton (
CART-CAFE-12), which accepts letters. - Typed with 12 digits, an EAN13 is completed when displayed: Dolibarr computes the check digit and
draws 13 digits, but keeps 12 in the database. The scanner reads the 13 digits on the label; the
product list filtered on
2000000000039finds nothing, and neither does the till. Always type all 13 digits.
3. Automatic numbering: the default mask is a trap
In the module setup, the Standard manager (“Manager to auto define barcode numbers”) suggests a
code for each new product. When you enable it, Dolibarr fills the mask with 04{0000000000}:
example shown 040000000001.
That mask has 12 digits: exactly the “typed with 12 digits” case in the table above. Our product
numbered 040000000001 prints as 0400000000015, and scanning that label finds no product.
The mask that works for EAN13 has 13 characters and ends with a star:
210{000000000}*
210: a fixed prefix;{000000000}: a 9-digit counter;*: the place of the check digit, which Dolibarr computes. This behaviour is in the code of the Standard manager, but the help on the page does not mention it.
Result, tested: 2100000000012, then 2100000000029… The labels read back identically and the
products are found when scanned.
Which prefix? GS1 reserves prefixes 20 to 29 for internal-use numbers (in-store labelling, company-specific codes). That is fine for your own labels; for products resold elsewhere you need codes assigned by GS1 (your national GS1 organisation), typed in by hand.
Three effects to know once numbering is enabled:
- the barcode becomes mandatory to create a product (“Barcode required”), including through the API (“ErrorBarCodeRequired”);
- the mask only checks the length of a code typed by hand: with
210{000000000}*, a code of 11, 12 or 14 characters is refused (“Bad syntax for barcode…”), but any 13 characters go through: a wrong check digit (2100000000108), another prefix (9990000000001), and evenABCDEFGHIJKLMwere saved without a message; - the counter restarts from the highest existing code: after typing
2100000000108by hand, the suggested code jumped to2100000000111.
Filling the products that have no code. Under the mask, the link “You can go on this page to initialize empty barcodes” opens a page that counts the products without a code and offers Init value for the 3 empty barcodes: three correct codes, read back without error. On the same page, the Erase all current barcode values button empties the codes of every product: don’t click it by mistake.
4. Printing labels
Tools › Print barcodes:
- choose the format of the labels page: Avery A4 or Letter sheets, DYMO 99012 and 99014 labels;
- the number of stickers;
- Fill barcode type and value from barcode of a product, choose the product, then the Get barcode button next to it;
- tick the product reference and label if you want them, then Generate page to print.

Our L7163 sheet (A4, 2 × 7) holds 14 identical labels, and the printed code reads back identically. One sheet = one code: to label 30 different products, you need 30 sheets.
5. Scanning at the till with TakePOS
At the till, the cursor is in the search field at the top: the scanner types the code there. Tested:
- a known code adds the product to the ticket, with no other click;
- the same item scanned twice gives two lines of quantity 1. To get one line of quantity 2: TakePOS › Setup › Parameters › Merge lines of the same products (tested: a single line, quantity 2);
- an unknown code, without any other setting, stays in the field with no message. The next scan is appended to it and is not found either.
The setting to make: in the TakePOS setup, on your terminal’s tab, the field Key ASCII code for
“Enter” defined in barcode reader = 13 (the Enter key most scanners send after the code; check your
scanner’s manual). With it, an unknown code shows “Not found (2000000000039)”, the text is
selected, and the next scan replaces it: the next product is added normally.
Scale labels (products sold by weight)
A labelling scale prints an EAN13 that holds the product and the weight. TakePOS can split it:
TakePOS › Setup › Parameters, field Barcode rule to insert product, in the form
ref:NB+qu:NB+qd:NB+autres:NB (number of characters of each part).
Tested with the rule ref:7+qu:2+qd:3+autres:1 and a product with reference 2123456, “Comté au
poids (kg)” at €24 excl. tax: scanning the label 2123456012507 adds the cheese with quantity 1.25
(1 kg + 250 g), i.e. €31.65 incl. 5.5 % VAT. Ordinary EAN13 codes keep working with the rule enabled.

Careful: the rule compares the ref part with the product reference, not with its barcode. The
split depends on your scale: check on one of its labels where the item number and the weight are.
6. Inventory by scanning
Products › Stocks › Inventories: create the inventory of a warehouse, Validate to load the list, then Complete real qty by scanning. A “Barcode scanner tool…” window opens: scan the items one under the other, one scan per item counted, with “Add” 1 for each barcode scanned.

Tested: 3 scans of the jam and 2 of the pasta, then Add: “Success !! The quantity was added to all the requested barcode”, the “Real Qty” column goes to 3 and 2. Then click Save under the list; we checked the quantities in the database after saving.
Trap: a single unknown code in the list cancels the whole batch (“Operation canceled for the following reason: Can’t find the following code in inventory: 2000000000039”), and no quantity is filled in. Scan in small batches, and remove the faulty code before trying again.
7. On PDF documents
Home › Setup › PDF, Shipments section: Show the barcode (of the shipment ref) on the shipping PDF
document. Tested with the Espadon template: a QR code appears at the top of the document, above
the table. According to the code, it holds the shipment reference (here SH2611-0001); the product
barcodes are not printed on the lines. The same page has the option for receptions and stock transfers
(not tested).
Summary of the tested settings
| Where | Setting | Tested value |
|---|---|---|
| Barcode module setup | Barcode generator (for each type used) | TCPDF-barcode |
| Barcode module setup | Default barcode type to use for products | EAN13 |
| Barcode module setup | Standard manager, mask | 210{000000000}* |
| TakePOS › terminal tab | Key ASCII code for “Enter” | 13 |
| TakePOS › Parameters | Merge lines of the same products | on |
| TakePOS › Parameters | Barcode rule to insert product (scale) | ref:7+qu:2+qd:3+autres:1 (depends on your scale) |
Frequently asked questions
Why doesn't my barcode scanner find the product in Dolibarr when the barcode is filled in?
Most often the code is stored with 12 digits while the label shows 13: Dolibarr adds the check digit when it draws the EAN13, the scanner reads 13 digits, and the search finds nothing. This is exactly what the default mask (04{0000000000}) produces. Use a 13-character mask ending with a star, for example 210{000000000}*, and fix the codes already created.
How do I generate valid EAN13 barcodes automatically in Dolibarr?
In the Barcode module setup, enable the Standard manager and set a 13-character mask ending with *, for example 210{000000000}*. Dolibarr then computes the 13th digit (the check digit): 2100000000012, 2100000000029… Products without a code can then be filled in one go with the 'initialize empty barcodes' link. GS1 reserves prefixes 20 to 29 for internal use: for products sold through other retailers you need codes assigned by GS1.
Can TakePOS read scale labels (products sold by weight)?
Yes, with the TakePOS setting 'Barcode rule to insert product'. Tested on 24.0.3 with ref:7+qu:2+qd:3+autres:1: the label 2123456012507 adds the product with reference 2123456 and a quantity of 1.25. The rule looks the product up by its reference, not by its barcode.