About serial numbers and batches ​

ERPNext can track stock below the Item level in two ways:

  • A serial number identifies one unit of an Item, for example one laptop. You can follow that unit from purchase to sale, check its warranty, and find it in a recall.
  • A batch identifies a group of units made or received together, for example one production lot of a medicine. All units in a batch share a manufacturing date and an expiry date.

An Item can use serial numbers, batches, or both.

Why track serial numbers or batches ​

NeedUse
Warranty or maintenance contract for each unitSerial numbers
Find the customer of one unit, for example for a recallSerial numbers
A cost for each unit, for example vehicles or machinesSerial numbers with serial number wise valuation
Expiry dates, for example food or medicineBatches
Trace a production lot to raw materials and customersBatches
Keep a sample of each lot for later testsBatches with sample retention

Tracking adds work to every stock transaction, because each one must name the serial numbers or batches. Use it only for Items where you need the detail.

Turn on serial and batch tracking ​

In ERPNext version 16, serial and batch tracking is off for new sites. To turn it on:

  1. In Stock Settings, open the Serial & Batch Item tab and select Activate Serial / Batch No for Item.
  2. In each Item that you want to track, select Has Serial No, Has Batch No, or both, in the Serial Nos / Batches section.

Until you select Activate Serial / Batch No for Item, the Has Serial No and Has Batch No checkboxes are locked in the Item. You cannot clear the setting again while any Item has serial or batch tracking, or after any Serial and Batch Bundle is submitted.

You cannot change Has Serial No or Has Batch No on an Item after it has a stock transaction. Decide before the first receipt. If you cannot select the checkboxes, see Cannot enable serial or batch tracking.

How a transaction records serial numbers and batches ​

Each stock transaction row for a tracked Item links to a Serial and Batch Bundle. The bundle lists the serial numbers or batches in the row, with a quantity for each.

You enter the serial numbers and batches in one of two ways, set in Stock Settings:

  • Use Serial / Batch fields selected (default): you type serial numbers in the row's Serial No field and select the Batch No. ERPNext creates the bundle when you submit.
  • Use Serial / Batch fields clear: you use the serial and batch selector dialog from the row. It creates the bundle while you work.

ERPNext can also create serial numbers and batches for you on receipt, and pick them for you on delivery. See Serial numbers, Batches, and Serial and Batch Bundle.

Negative stock ​

ERPNext does not allow negative stock for serial numbers, even if Allow negative stock is selected in Stock Settings. For batches, Allow negative stock for Batch in Stock Settings, or Allow Negative Stock for Batch in one batch, allows negative stock caused by back-dated entries only. Negative batch stock can give wrong valuation rates, so avoid it.