October 27, 2025

14 Views

ERP

Mastering Naming Series in ERPNext: The Complete Setup Guide

...
Mradul Mishra
CTO Techsolvo
Table of Contents

 

1. Introduction

A naming series in ERPNext defines how document IDs are automatically generated. It helps maintain order, traceability, and consistency across transactions. For example, instead of random IDs, you can have structured formats like INV-2025-0001 for invoices.

In this guide, we’ll explore how to create and customize naming series in ERPNext, including examples for various industries and advanced setups.


2. Accessing Naming Series Settings

You can manage naming series from:

  • Settings → Naming Series, or

  • Customize Form → Naming Series Field within a specific doctype (like Sales Invoice, Purchase Order, etc.)

ERPNext allows you to define your own prefixes, dynamic fields, and numbering patterns.


3. Basic Custom Naming Series Examples

Example 1: Custom Invoice Format

Series: INV-.YYYY.-.####

Output: INV-2025-0001

Explanation:

  • INV = static prefix

  • .YYYY. = year (2025)

  • #### = 4-digit incremental counter


Example 2: Branch-Specific Purchase Order

Series: PO-{branch_abbr}-.####

Output: PO-BPL-0001 (for Bhopal branch)

Use a custom field (branch_abbr) in your doctype and include it dynamically in the naming format.


4. Industry-Specific Naming Series Examples

Example 3: Hospital / Lab Module

Series: LABT-.YY.-.MM.-####

Output: LABT-25-10-0001

Useful for lab tests, patient registrations, or reports. The .YY. and .MM. parts automatically include year and month.


Example 4: Manufacturing

Series: JOB-.YYYY.-.#####

Output: JOB-2025-00001

Good for work orders or job cards in manufacturing environments.


Example 5: Pharmacy / Retail

Series: RX-.###

Output: RX-101

Simple sequence for prescriptions or small retail transactions.


5. Advanced Use-Cases

Example 6: Fiscal Year–Wise Reset

ERPNext supports Per Fiscal Year Series. If enabled, the numbering restarts at the beginning of every fiscal year.

Series: INV-.YYYY.-####

Year 2025 Output: INV-2025-0001

Year 2026 Output: INV-2026-0001


Example 7: Company-Wise Naming

Series: INV-{company_abbr}-.YYYY.-####

Output: INV-SME-2025-0001

Useful in multi-company setups where each company maintains its own numbering sequence.


Example 8: Dynamic Prefix Using Custom Script

If you want to dynamically assign prefixes based on a field (like customer group or region), use a client-side script.

Example Script:

frappe.ui.form.on('Sales Invoice', {
    before_save: function(frm) {
        frm.doc.naming_series = `INV-${frm.doc.customer_group}-.####`;
    }
});

Output: INV-Retail-0001 or INV-Wholesale-0001


6. Error Handling & Best Practices

Common Issues:

  • Naming series not showing: Check if the field is enabled for that doctype.

  • Duplicates or conflicts: Use unique prefixes per series.

Tips:

  • Test custom series in a sandbox environment.

  • Avoid frequent format changes after production use.

  • Keep naming conventions consistent across modules.


7. Bonus Demos

You can go further by:

  • Creating a new custom doctype and setting a unique naming format.

  • Using Server Scripts or autoname method in a custom app for full control.

Example in a custom app:

def autoname(self):
    self.name = make_autoname(f"JOB-{self.department_abbr}-.####")

8. Conclusion

Custom naming series in ERPNext empower you to build smarter document tracking that aligns with your business logic. Whether you manage invoices, lab tests, or manufacturing jobs, the naming series can be tailored for each scenario.

Next Step: Watch or read the tutorial on “Resetting Naming Series per Fiscal Year Automatically in ERPNext.”

Let's get in touch

Give us a call or drop by anytime, we endeavour to answer all enquiries within 24 hours on business days.

Let's Convert Your Idea into Reality

Insights

To properly understand the things that are prevalent in the industries, keeping up-to-date with the news is crucial. Take a look at some of our expertly created blogs, based on full-scale research and statistics on current market conditions.

blog-image
ERP

Mastering Naming Series in ERPNext: The Complete Setup Guide

Learn how to configure, customize, and automate Naming Series in ERPNext. This guide cove…

author
Mradul Mishra

Oct. 27, 2025

blog-image
ERP

How ERPNext Transforms Construction Businesses in the UAE | Techsolvo

Learn how ERPNext helps UAE construction firms streamline projects, procurement, retentio…

author
Mradul Mishra

Oct. 27, 2025

blog-image
ERP

Why ERPNext is the Best ERP Software for Businesses in 2025 | Techsolvo

Discover why ERPNext is the top choice for modern businesses in 2025. Learn how Techsolvo…

author
Mradul Mishra

Oct. 27, 2025