Setting Up ERPNext for a Generic Drug Manufacturer: Warehouse, Batch Tracking, and Item Master

The first two articles in this series covered why pharmaceutical manufacturers need more than Excel and why ERPNext deserves attention. This article is hands-on: configuring ERPNext from day one for a generic drug manufacturer.

The content draws from a structured 10-week exploration of ERPNext for Thai generic pharma. All product names and figures are illustrative.

Starting Point: Create a Demo Company

Navigate to Setup → Company → New

Field Example Value Note
Company NameGeneric Pharma Demo Co., Ltd.Demo name
AbbreviationGPDUsed as document prefix
Default CurrencyTHBThai Baht
CountryThailandAuto-loads tax template
IndustryPharmaceutical

On Save, ERPNext auto-generates a Chart of Accounts based on the selected country.

Warehouse Configuration: Mapping GMP Zones

In GMP, each storage area has specific status and conditions. Incoming raw materials must remain on "hold" until QC approves them. ERPNext handles this through separate, discrete Warehouses.

Navigate to Stock → Warehouse → New and create these six:

Warehouse GMP Role
Raw Material StoreApproved materials, available for use
Quarantine StoreIncoming materials, pending QC
Work in ProgressMaterials in active production
Finished Goods StoreFG awaiting QC release
Released StoreQC passed, available for dispatch
Rejected StoreFailed batches or lots

Why separate Quarantine? GMP requires physical or status segregation between unapproved and approved materials. Since ERPNext uses warehouse transfers rather than status fields, moving stock from Quarantine to Raw Material Store effectively represents QC approval. Track whether this logic satisfies your SOP and auditor expectations.

Item Master: The Foundation of Inventory

In ERPNext, every purchased, manufactured, or sold entity is an Item — APIs, excipients, packaging materials, and finished products alike.

Create Item Groups First

Navigate to Stock → Item Group → New and create:

  • API
  • Excipient
  • Packaging Material
  • Finished Product

Example: API Item

Navigate to Stock → Item → New

Atorvastatin Calcium:

Field Value
Item CodeAPI-ATO-001
Item NameAtorvastatin Calcium
Item GroupAPI
UOMkg
Has Batch No✓ (critical)
Has Expiry Date
Is Purchase Item
Default WarehouseRaw Material Store

Important: Enable "Has Batch No" from the start. Once transactions exist against an Item, this setting cannot be changed.

Example: Finished Product Item

Atorvastatin Tablet 20mg:

Field Value
Item CodeFG-ATO-020
Item NameAtorvastatin Tablet 20mg
Item GroupFinished Product
UOMtablet
Has Batch No
Has Expiry Date
Is Manufactured Item
Is Sales Item
Default WarehouseFinished Goods Store

Recommended Naming Convention

A structured Item Code system makes reporting and filtering significantly easier:

API-[3-letter-INN]-[sequence] EXC-[abbreviation]-[sequence] PKG-[type]-[product]-[sequence] FG-[INN]-[strength in mg]

Examples:

  • API-ATO-001 = Atorvastatin API
  • EXC-MCC102-001 = Microcrystalline Cellulose PH102
  • PKG-BLISTER-ATO20 = Blister film for ATO 20mg
  • FG-ATO-020 = Atorvastatin 20mg tablet

What ERPNext Is Missing for Pharma

After initial setup, you’ll notice gaps in the Item master for pharmaceutical use:

  • Pharmacopoeial grade (USP, BP, Ph.Eur.)
  • Retest date (separate from expiry date)
  • Approved supplier list per material
  • Certificate of Analysis linkage per batch received

These require Custom Fields in Frappe — achievable without coding using ERPNext’s built-in Customize Form tool.

Observation-Logging Practice

The first setup is not just configuration — it’s a structured opportunity to understand how the system thinks. Recommended practice: log every moment you notice:

  • "The system requires this workflow step — does it match our SOP?"
  • "This field doesn’t exist — custom field needed?"
  • "Would this report satisfy an auditor?"

These observations become the raw material for a Gap Analysis — the most valuable output of the exploration phase.

Summary

Week 1 setup covers the three foundational layers:

  1. Company — the parent record for all ERPNext data
  2. Warehouse — GMP zone logic mapped to ERPNext warehouse transfers
  3. Item Master — APIs, excipients, packaging, and finished products with batch tracking enabled

Next up: testing Inventory transactions — receiving an API into a quarantine batch, simulating QC approval via warehouse transfer, and evaluating how well the traceability report answers the auditor’s first question: "Where did this batch come from?"

Scroll to Top