Skip to content
TAQNIX
Odoo ModulesWordPress PluginsWordPress ThemesShopify ThemesApp TemplatesScripts & UtilitiesBlogSell on TAQNIX

Automated SKU & Barcode Generator for Odoo 19 documentation

A guide to automatic SKUs and barcodes: how the codes are built, the settings, prefixes per category, variants, filling existing products, and the guarantees.

Documents version 1.0.1Updated Oct 23, 2026

Start here

In plain words: Every product needs a code: an SKU that people can read and say on the phone, and a barcode that scanners can read. Typing them by hand means gaps, duplicates and “which one did we use last?”. This module gives every new product both, automatically, the moment you save it.
A new product, saved without typing a code: Reference FUR-0001 and an EAN-13 barcode.
A new product, saved without typing a code: Reference FUR-0001 and an EAN-13 barcode.
What you doWhat the module does
Save a new productFills the Reference (SKU) with the category prefix and the next number, and the Barcode with a valid EAN-13.
Add variants (colour, size)Every variant gets SKU-RED-M style code and its own barcode.
Already have thousands of products without codesOne click fills the missing ones. Codes that exist are never touched.
Tip: Nothing you typed is ever overwritten, and the module never creates a duplicate: if a code is already taken, it takes the next free one.

What the codes look like

CodeExampleBuilt from
SKU of a productFUR-0042category prefix FUR + separator - + number 0042
SKU of a variantCLO-0001-RED-Mthe product's SKU + the first 3 letters of each option (Red, M)
Barcode (EAN-13)2000000000015your prefix 200 + a counter 000000001 + the check digit 5
Barcode (same as SKU)FUR-0042the SKU itself, as a Code 128 barcode
In plain words: The prefix, the separator, the number of digits and the barcode type are all settings. The check digit is calculated for you, so every EAN-13 is valid and scans first time.
Tip: 200 to 299 are the numbers GS1 reserves for internal use, so they never clash with barcodes that suppliers print on their goods. You can choose any prefix of 2 to 8 digits.

Requirements

ItemDetails
Odoo19.0 (Community or Enterprise)
Apps neededOnly the base Products app (product), which every Sales, Inventory, Purchase or Point of Sale database has
LicenseOPL-1 (Odoo Proprietary License v1.0)

Install

  1. Unzip the package. Inside is taqnix_sku_barcode_generator.zip; unzip it to get the folder taqnix_sku_barcode_generator.
  2. Copy the folder into one of the addons_path folders of your Odoo server and restart Odoo.
  3. Log in as an administrator, activate Developer mode, open Apps and press Update Apps List.
  4. Remove the “Apps” filter, search SKU and press Install.
# or from the command line
./odoo-bin -c odoo.conf -d YOUR_DATABASE -i taqnix_sku_barcode_generator --stop-after-init
Tip: Installing changes nothing on your existing products. From then on, new products get codes. Use chapter 9 to fill the old ones.

Settings

In plain words: Open Settings → Product Codes. The settings belong to each company.
Settings → Product Codes: SKU and barcode.
Settings → Product Codes: SKU and barcode.
SettingWhat it does
Generate the SKU for new productsSwitch the automatic SKU on or off.
Default prefixUsed for products whose category (and its parents) has no prefix. Default PRD.
SeparatorPut between prefix, number and variant options. Default -.
Digits in the number4 gives 0001 to 9999; 6 gives 000001. Default 4.
Generate the barcode for new productsSwitch the automatic barcode on or off.
Barcode typeEAN-13 with your own prefix, or the SKU as the barcode.
EAN-13 prefix2 to 8 digits at the start of every barcode. Default 200.

Prefix per category

In plain words: The SKU starts with the prefix of the product's category. Open Inventory → Configuration → Product Categories (or Sales or Invoicing, wherever you keep categories) and fill SKU prefix.
The category Furniture has the prefix FUR.
The category Furniture has the prefix FUR.
RuleExample
A category with a prefix uses itFurniture: FUR → FUR-0001, FUR-0002…
A sub-category without a prefix uses its parent's, and shares its counterFurniture / Office → FUR-0003
Only letters and digits, up to 12, always capitaloff is saved as OFF
No prefix anywhere up the treeThe default prefix: PRD-0001
Two categories with the same prefixThey share one counter: no clash
A sub-category with no prefix of its own: it shows the prefix in use and the next number.
A sub-category with no prefix of its own: it shows the prefix in use and the next number.
In plain words: Next number shows the number the next product will get. You can change it, for example to continue after an old system: write 5000 and the next product is FUR-5000.

New products

In plain words: Create a product as usual and save it. If the Reference or the Barcode is empty, the module fills it. That is all.
SituationResult
You typed a ReferenceIt is kept. Only the barcode (if empty) is generated.
You typed a BarcodeIt is kept. Only the Reference (if empty) is generated.
You duplicate a productThe copy gets new codes (Odoo does not copy them).
The product is created by an import, the website or another appSame: empty codes are filled, existing ones kept.
The number you would get is already used by another productThe module takes the next free one.
The barcode is already used by another product or packagingThe module takes the next free one.
In plain words: The product title shows the code in brackets, [FUR-0001] Ergonomic Standing Desk, in orders, deliveries and invoices.

Variants

In plain words: Products with options (colour, size…) have one variant per combination. Each variant gets its own SKU and its own barcode, because that is what you scan and ship.
A T-shirt in 2 colours and 3 sizes: six variants, six SKUs, six barcodes.
A T-shirt in 2 colours and 3 sizes: six variants, six SKUs, six barcodes.
OptionIn the SKU
RedRED
BlueBLU
MM
LargeLAR
In plain words: The product's own SKU (here CLO-0001) is the base, and each option adds its first 3 letters. If two variants would get the same code, the second gets -2.
Tip: A product with variants shows no Reference on its own form: the codes live on the variants. Open the Variants button, or the Product Variants list.
In plain words: If you add a new colour later, the new variants get their codes automatically; the existing ones keep theirs.

Products that already exist

In plain words: Products created before you installed the module, or created with the automatic mode switched off, have no codes. Fill them in one go.
A product without codes shows the Generate Codes button.
A product without codes shows the Generate Codes button.
  1. In the product list, tick the products you want (or none).
  2. Open Actions → Generate missing codes.
  3. Choose the scope: the selected products, a category (with its sub-categories) or all products.
  4. Check the counts under What will happen, tick SKU and/or barcode, and press Generate.
Actions → Generate missing codes, in the product list.
Actions → Generate missing codes, in the product list.
The scope and the counts before anything is changed. “Products in scope” counts variants.
The scope and the counts before anything is changed. “Products in scope” counts variants.
Afterwards every product has its code. Products with variants show them on each variant.
Afterwards every product has its code. Products with variants show them on each variant.
In plain words: For a single product use the Generate Codes button on its form. It is visible only while the Reference or the Barcode is empty.

Rules and guarantees

GuaranteeHow
Never overwritesOnly empty Reference and Barcode fields are filled.
No duplicate SKUThe number is skipped if any product (archived ones included) already has that SKU.
No duplicate barcodeSkipped if any product or packaging already has it.
Valid EAN-1313 digits, check digit calculated, 12-digit base made of your prefix and a counter.
Counters never go backwardsThey are database sequences, safe when several users save at the same moment.
Numbers are not reusedA deleted or cancelled product leaves a gap. That is normal and keeps codes unique.
Several companiesSettings are per company; SKU counters are shared by prefix, barcode counters are per company.
Important: Changing a category's prefix does not rename the SKUs that already exist. Old products keep their old code; new ones use the new prefix.

For developers

In plain words: Skip this chapter if you only use the module.
ItemDetails
product.product._tx_assign_codes(force=False)Fills the missing codes of the products. force ignores the automatic switches. Returns (SKUs made, barcodes made).
_tx_make_sku(company) / _tx_make_barcode(company)Return the next free code. Override them to change the format.
Context tx_skip_codesSet it to True to create products without generating codes (for example in a migration).
Context install_modeData loaded by modules is never given codes.
taqnix.sku.toolsean13_check_digit() and is_valid_ean13().
# create products without codes, then fill them later
products = env['product.product'].with_context(tx_skip_codes=True).create(vals_list)
products._tx_assign_codes(force=True)

# your own format: PREFIX/YEAR/NUMBER
class ProductProduct(models.Model):
    _inherit = 'product.product'

    def _tx_make_sku(self, company):
        sku = super()._tx_make_sku(company)
        return sku.replace('-', '/', 1)

Troubleshooting

ProblemWhat to do
A new product has no codeThe automatic switch is off in Settings → Product Codes, or the product was created with tx_skip_codes. Use the Generate Codes button.
The product list shows no Reference for a product with variantsThat is how Odoo works: the codes are on the variants.
“The EAN-13 prefix must be 2 to 8 digits”Use digits only, between 2 and 8 of them.
“The SKU prefix can only contain letters and digits”Remove spaces, dashes and symbols from the category prefix.
The numbers jumpA number is skipped when a product already uses that SKU, and a deleted product leaves a gap. Both are normal.
I want the SKU to restart at 1Open the category and set Next number to 1, but only if no product has such an SKU: the module skips used ones.

Updating and removing

Replace the folder with the new version, restart Odoo and run -u taqnix_sku_barcode_generator. To remove it, uninstall it from Apps. The codes already given stay on your products, as ordinary Reference and Barcode values. The prefixes, counters and settings are removed.

Support

Installation help and bug fixes are included for 6 months, with lifetime updates. Contact us through the marketplace page where you bought the module or write to support@taqnix.com with your Odoo version and a screenshot.