Map raw materials to finished goods ​

In a Manufacture or Repack Stock Entry, you can record which raw material serial number or batch went into which finished good serial number or batch. Without this map, ERPNext knows only that a group of raw materials and a group of finished goods were in the same entry. If you make 3 laptops from 3 motherboards, you cannot tell which motherboard is in which laptop.

The map helps when:

  • A customer complains about one finished good, and you need the exact raw material in it.
  • A supplier recalls a raw material batch, and you need only the finished goods that used it.
  • An auditor or a regulator asks for the full history of a product, from supplier to customer.

The Serial No and Batch Traceability report then shows the exact link in both directions.

Prerequisites ​

  • The Stock Entry has the purpose Manufacture or Repack.
  • The finished good and the raw materials have serial numbers or batch numbers.
  • The serial numbers or batches of the finished goods are set on the entry and saved.
  • The Stock Entry is a draft or submitted, not cancelled.
  • You have write permission on Stock Entry. Read permission lets you open the dialog but not save.

Choose when to map ​

The Auto create Serial and Batch Bundle for outward setting in Stock Settings is on by default. It decides when the raw material serial numbers and batches are known:

  • If you pick the raw material serial numbers or batches yourself in the draft, you can map them before you submit.
  • If you let ERPNext pick them, it does so only on submit. Submit first, then map.

WARNING

After you submit the Stock Entry, a mapped raw material cannot be changed or cleared. Check the map before you submit. To correct a saved map on a submitted entry, cancel the Stock Entry and create it again.

Map in a draft Stock Entry ​

  1. Create the Manufacture or Repack Stock Entry. Add the raw materials and finished goods with their serial numbers or batches.
  2. Select Actions > Map Raw Materials to Finished Goods. ERPNext saves unsaved changes first.
  3. The dialog has one row for each raw material serial number or batch. Item Code, Serial No, Batch No, and Qty are read-only. In Finished Good Serial / Batch No, select the finished good that the raw material went into. You can leave a row empty.
  4. Optionally, select Auto Assign to fill the rows, then correct any row.
  5. Select Save. ERPNext shows "Mapping saved".

You can open the dialog and change the map as often as you like until you submit.

If you change a finished good's serial number or batch after you map it, the map can point to a serial number or batch that is no longer on the entry. Submit then stops with an error. Open the dialog again and fix the map.

What Auto Assign does ​

Auto Assign fills the dialog only. Nothing is saved until you select Save.

  • With one finished good, every raw material row is assigned to it.
  • With several finished goods, the serialized raw materials of each item are split evenly across the finished goods, in the order shown. For example, 6 serial numbers and 3 finished goods give 2 serial numbers each.
  • If the serial numbers of an item cannot be split evenly, for example 5 serial numbers for 3 finished goods, the rows of that item stay empty.
  • Batch raw materials are not assigned when there are several finished goods. Select them yourself.

Map after you submit ​

Use this when ERPNext picked the raw material serial numbers or batches on submit, or when you left rows empty in the draft.

  1. Open the submitted Manufacture or Repack Stock Entry.
  2. Select Actions > Map Raw Materials to Finished Goods. The dialog shows only the raw materials that are not mapped yet.
  3. Select the finished good for each row, or use Auto Assign, then select Save.

If all raw materials are mapped, ERPNext shows "All raw materials are already mapped to finished goods".

If two people map the same raw material on a submitted entry, the first save wins. The second person gets an error that the raw material is already mapped. Nothing is overwritten.

What happens on submit ​

  1. ERPNext checks the map. If a raw material points to a serial number or batch that is not a finished good of this entry, submit stops with an error.
  2. ERPNext keeps your map.
  3. The Auto Map Raw Materials to Finished Goods setting in Stock Settings decides what happens to empty rows:
SettingEmpty rows on submit
Off (default)Stay empty. You can map them after submit.
OnSerialized raw materials are spread evenly across the finished goods, in order.

Turn the setting on only if your raw materials are always used in the same order as the finished goods are made. Otherwise the automatic map may not match what happened on the shop floor.

A batch raw material with several finished goods is not mapped to one of them, because a batch is usually shared. It stays linked to all finished goods of the entry, and the traceability report shows it under each one. The same applies to any raw material that is not mapped.