How to Automatically Generate Item Codes in ERPNext v16?

Hello everyone,

I am very new to ERPNext and still learning the basics, so I would appreciate a beginner-friendly explanation with step-by-step instructions.

When creating a new item, I don’t want to enter the item code manually. Instead, I want ERPNext to automatically generate a unique, sequential code and fill it in the Item Code field.

For example:

  • ITEM-0001

  • ITEM-0002

  • ITEM-0003

All items should use the same prefix, ITEM-, followed by an automatically incrementing number.

Is it possible to set this up using ERPNext’s standard features without writing custom code?

If so, could you please explain how to configure it step by step?

Thank you for your patience and help!

Yes, you can do this without any custom code. It’s just two settings.

First, tell ERPNext to name items by series. Open Stock Settings (press Ctrl+K and type it). Find “Item Naming By” and change it from “Item Code” to “Naming Series”. Then save.

Second, set your prefix. Search for “Document Naming Settings” (some versions call it “Naming Series”). Under “Select Transaction” pick Item. In the series list box, remove what’s there and type ITEM-.####. The four # signs mean four digits, so you’ll get ITEM-0001, ITEM-0002, ITEM-0003 and so on. Click Update, set ITEM-.#### as the Default Series, and save.

Then test it. Go to Stock > Item > Add Item, fill in the item name and group, and save. The first item should come out as ITEM-0001.

A few things that may help:

  • Items you already created keep their old codes. Only new ones use the new series.
  • If you want to start at a different number, use “Update Series Counter” on the same Document Naming Settings page.
  • If the new series doesn’t show up on the item form, refresh the page with Ctrl+Shift+R.

Hope this guide helps you!

Hi @saber2q and welcome to the community

In addition to all the great answers above you may sometimes want to consult the official docs

Best of luck on your ERPNext journey

Thank you all for your help and guidance. I really appreciate your support!

i also have another question:

After creating and saving a new Item, it does not immediately appear in the Item List. I have to manually refresh the page to see it.

Is there a way to automatically refresh the Item List whenever a new Item is saved, without manually refreshing the page?

in the main menu (in red square of picture), how can i change the icons and Tip-Text in mouse over?