Introducing a new way to review your PRs.

Read the announcement

frappe / erpnext

Free and Open Source Enterprise Resource Planning (ERP)

View on GitHub

20 documents · Updated Nov 23, 2026

docs / inventory-replenishment-and-traceability

Replenishment and inventory traceability

ERPNext keeps physical inventory available at the right warehouse and preserves its history from receipt to issue, transfer, manufacture, and delivery. Replenishment turns a stock shortfall or planned material need into a fulfillment request. Warehouse documents then move the material, while serial numbers and batches identify the units or groups that moved.

Replenishment model

Reorder policy

An item can have a reorder policy for each warehouse and material request type. The policy defines the stock level that should trigger action and the quantity to request. A warehouse group can widen the stock check to its child warehouses, while the request still targets a concrete warehouse.

The automatic reorder task considers active stock items with a reorder policy. It compares projected quantity with the reorder level. When projected quantity is at or below that level, it creates a submitted Material Request and marks it as created by reorder. The request type controls the next supply path:

Request typeSupply intent
PurchaseBuy the item from a supplier.
Material TransferMove the item from another warehouse.
Material IssueIssue stock for internal use.
ManufactureMake the item through production.
SubcontractingSend material for supplier processing.
Customer ProvidedReceive or issue material provided by a customer.

The requested quantity is normally the policy quantity. If the shortage is greater than that quantity, the request covers the shortage needed to reach the reorder level. The planned date also reflects the item lead time. The system can notify purchase or stock managers after automatic requests are created.

References: erpnext/…/item_reorder.json• L10-58 erpnext/…/item.py• L571-609 erpnext/…/reorder_item.py• L14-105 erpnext/…/reorder_item.py• L213-304

Stock demand signals

Reorder decisions use projected stock rather than only stock on hand. Projected quantity brings together the stock position and open demand or supply such as planned quantity, indented quantity, ordered quantity, and reservations. The Stock Projected Qty report exposes these values with the reorder level, reorder quantity, and shortage so a planner can explain why a request is needed.

Production planning uses the same idea for material demand. It expands the bill of materials for planned output, checks stock across the selected warehouse scope, and accounts for existing ordered material, safety stock, minimum order quantity, and unit conversion. If stock is available in another warehouse, the plan can create a transfer request for that quantity and a purchase request for the remainder.

References: erpnext/…/stock_projected_qty.py• L30-83 erpnext/…/material_request.py• L375-433 erpnext/…/material_request.py• L480-610 erpnext/…/material_request.py• L613-672

Material demand and fulfillment

Material Request

A Material Request is the common demand document for material from an internal warehouse or from a supplier. It can also express a need to issue material, manufacture an item, subcontract work, or receive customer-provided material. Its item rows carry the required warehouse, source warehouse when relevant, quantity, unit, schedule date, and links to the demand source.

Material Requests can come from automatic reorder, production planning, a work order, or a user. When a request comes from a Sales Order, its company and item-row details must still match the source order. The document tracks ordered and received progress. For internal movement or manufacture, it also tracks issued or transferred progress. A submitted request updates the related stock demand and, when linked to a production plan or work order, updates that plan's material coverage. Stopping or cancelling the request removes its open demand and refreshes the linked production or work-order quantities.

The Material Request page exposes the next action for the selected request type. Purchase demand can move to supplier documents, internal demand can move to a Pick List or Stock Entry, and manufacturing demand can move to Work Orders. For purchase demand with several default suppliers, the user can assign suppliers by item before separate Purchase Orders are created. Standard list views help planners find drafts, requests due in seven days, purchase requests still to order, and transfers still to complete.

The request is a coordination point rather than the physical movement itself. Purchase orders and receipts satisfy purchase requests. Pick Lists and Stock Entries satisfy internal transfer or issue requests. A Manufacture request can lead to a Work Order when a suitable bill of materials exists. The request quantity stays bounded by the remaining demand of a linked work order or production-plan item.

References: erpnext/…/README.md• L1 erpnext/…/material_request.py• L115-129 erpnext/…/material_request.py• L171-178 erpnext/…/material_request.py• L296-374 erpnext/…/material_request.py• L407-470 erpnext/…/material_request.py• L475-626 erpnext/…/material_request.py• L710-786 erpnext/…/material_request.js• L168-251 erpnext/…/material_request.js• L433-609 erpnext/…/material_request.js• L630-697 erpnext/…/mapper.py• L86-167 erpnext/…/mapper.py• L218-319 erpnext/…/mapper.py• L371-521 erpnext/…/material_request_drafts.json• L1-21 erpnext/…/material_request_required_in_7_days.json• L1-21 erpnext/…/material_request_to_order.json• L1-21 erpnext/…/material_request_to_transfer.json• L1-21

Production material demand

A Production Plan converts planned finished goods into raw-material demand. It connects the demand to the sales or production source, the bill of materials, and the target warehouse. The plan can create grouped Material Requests for the remaining quantity and keep a link to the plan item so later receipt or production updates the plan.

A Work Order gives the manufacturing floor an executable requirement for one finished item. Its required-item view keeps the material requirement and the quantities that are requested, picked, transferred, returned, and consumed. This lets a planner distinguish material that is merely requested from material that has reached production.

The work order protects this demand from over-fulfillment. A new transfer or pick quantity is compared with the required quantity after existing transfers, open requests, and open picks are considered. This keeps multiple fulfillment documents from consuming the same requirement twice.

References: erpnext/…/material_request.py• L42-130 erpnext/…/production_plan.py• L264-299 erpnext/…/README.md• L1 erpnext/…/required_items.py• L36-61 erpnext/…/required_items.py• L215-304 erpnext/…/required_items.py• L360-379

Warehouse fulfillment documents

Warehouse fulfillment uses documents that state what should move and documents that record what did move. A Pick List selects source locations and quantities without posting warehouse stock. A Stock Entry posts the actual receipt, issue, transfer, or manufacturing movement. A Purchase Receipt records material received from a supplier. A Delivery Note records material shipped to a customer.

These documents carry links back to their demand or source documents. Their status quantities roll up to Material Requests, Work Orders, Purchase Orders, Sales Orders, and Pick Lists. A submitted movement therefore changes both the warehouse stock position and the progress of the business demand. Creating a delivery or Stock Entry from a Pick List checks access to the source list before it creates the next document.

A product bundle is a sellable item whose fulfillment uses one or more stock components. Pick List mappings keep the picked component warehouse and serial or batch identity when they create a Delivery Note or Sales Invoice. Partial delivery reduces only the remaining bundle and component demand, so a later document can complete the order without repeating identifiers already delivered.

Stock Reservation Entries hold stock for a source voucher and can pin the exact serial numbers or batches. Delivery, transfer, and consumption reduce the open part of a reservation and move it through reserved, partly used, delivered, or closed states. Cancellation gives unused stock back and restores delivery progress when a delivery is cancelled. Pick List cancellation cancels open reservations created from that Pick List. This keeps stock held for one demand from becoming available to a different demand by accident.

The main fulfillment roles are:

DocumentRole in the flow
Pick ListSelect and reserve the physical source stock for a transfer, delivery, or manufacturing need.
Stock EntryPost an internal movement, material issue or receipt, or manufacturing movement.
Purchase ReceiptRecord supplier stock entering a warehouse against purchasing demand.
Delivery NoteRecord stock leaving a warehouse for a customer.
Stock Reservation EntryHold quantity or named serials and batches for a submitted source document.

References: erpnext/…/mapper.py• L30-66 erpnext/…/mapper.py• L290-403 erpnext/…/mapper.py• L454-485 erpnext/…/pick_list.py• L44-94 erpnext/…/pick_list.py• L188-288 erpnext/…/pick_list.py• L368-470 erpnext/…/pick_list.py• L540-753 erpnext/…/stock_reservation_entry.py• L79-149 erpnext/…/stock_reservation_entry.py• L144-287 erpnext/…/stock_reservation_entry.py• L595-685 erpnext/…/stock_reservation_entry.py• L2241-2258 erpnext/…/purchase_receipt.py• L151-181 erpnext/…/delivery_note.py• L160-189 erpnext/…/test_stock_reservation_entry.py• L323-415 erpnext/…/test_stock_reservation_entry.py• L568-607 erpnext/…/test_pick_list.py• L1289-1311 erpnext/…/test_pick_list.py• L1453-1518

Replenishment and fulfillment flow

The following flow shows how a shortage becomes a request and then becomes a traceable stock movement. A Pick List is the allocation step in the middle; only its later Delivery Note or Stock Entry changes stock.

flowchart LR
    A[Reorder policy or production demand] --> B[Projected stock check]
    B -->|Shortage| C[Material Request]
    C --> D{Supply path}
    D -->|Purchase| E[Purchase Order and Purchase Receipt]
    D -->|Transfer or issue| F[Pick List]
    F --> G[Stock Entry]
    D -->|Manufacture| H[Work Order]
    H --> I[Material transfer and consumption]
    E --> J[Warehouse stock]
    G --> J
    I --> J
    J --> K[Stock ledger and serial or batch history]

The request records intent. The fulfillment document records the physical event. The stock ledger and the serial or batch record then provide the inventory state and its trace back to the source voucher.

Pick List allocation accounts for stock already held by other open Pick Lists or by stock reservations. It reports actual, picked, reserved, and free quantity for an item and warehouse. When it builds locations automatically, it can draw from several warehouses, use a work order's source warehouse first, and retain the remainder for later replenishment. A Pick List created with manual picking enabled keeps the user's locations, quantities, batches, and serial numbers instead of replacing them with automatic locations. Allocation also keeps serialized stock in a stable order and does not claim stock already reserved for another demand. Location rebuilding requires write access on an existing Pick List. Concurrent allocation locks the demand and holding rows before it accepts a quantity.

For transfer and delivery purposes, a submitted Pick List can be fulfilled in parts. A later Delivery Note or Stock Entry uses only the pending quantity and identifiers for the Pick List row. Each Stock Entry reduces the remaining picked quantity. The Pick List shows a partial transfer until the full picked quantity moves, while Delivery Note progress uses a separate delivered status. A work-order Pick List stays within the pending quantity of a live Material Request and the remaining work-order material need. Cancelling the Pick List cancels its open reservations and cancels or delinks its draft trace records.

References: erpnext/…/reorder_item.py• L31-75 erpnext/…/mapper.py• L371-521 erpnext/…/mapper.py• L290-403 erpnext/…/mapper.py• L454-485 erpnext/…/pick_list.py• L188-288 erpnext/…/pick_list.py• L368-470 erpnext/…/pick_list.py• L540-753 erpnext/…/pick_list.py• L778-912 erpnext/…/pick_list.py• L1050-1087 erpnext/…/pick_list.py• L1291-1311 erpnext/…/pick_list.py• L1500-1537 erpnext/…/test_pick_list.py• L1056-1105 erpnext/…/test_pick_list.py• L1168-1287 erpnext/…/test_pick_list.py• L1453-1520 erpnext/…/test_pick_list.py• L1594-1623 erpnext/…/stock_reservation_entry.py• L2110-2156

Inventory traceability

Warehouse identity

A Warehouse is a physical or virtual location in the stock network. Warehouses can form a parent-child tree, which lets the system report or check stock for a group while still posting stock to a leaf warehouse that can hold inventory.

The warehouse is part of the identity of a stock balance. It is also part of the trace record for a serial number, batch, stock ledger entry, and fulfillment document. A warehouse with stock or transaction history cannot be removed, which protects the continuity of the inventory record.

References: erpnext/…/README.md• L1 erpnext/…/warehouse.py• L21-53 erpnext/…/warehouse.py• L102-127 erpnext/…/warehouse.py• L233-238

Serial number identity

A Serial No identifies one unit of an item. It supports unit-level tracking when warranty, service, or recall history matters. The serial record keeps the item, current warehouse, batch when applicable, source reference, status, and warranty or maintenance dates. Its maintenance status reflects current warranty or annual maintenance coverage.

Serial numbers enter and leave inventory through stock documents. An outward movement must use a serial number that belongs to the item and is present in the source warehouse. An inward movement cannot reuse a serial number that is already in stock unless the relevant stock setting allows it. These checks stop the same unit from appearing in two places at once.

Delivery, maintenance, and quality roles can select serial records for their workflows without receiving record-edit rights. Standard views expose units that are in stock, delivered, or close to warranty expiry. The serial number ledger presents each unit's movement with its posting time, voucher, warehouse, quantity direction, status, and valuation rate. This is the main view for following one unit from receipt through transfer, delivery, return, or consumption.

References: erpnext/…/README.md• L1 erpnext/…/serial_no.json• L230-317 erpnext/…/serial_no.py• L28-60 erpnext/…/serial_no.py• L67-123 erpnext/…/serial_no_ledger.py• L97-165

Batch identity

A Batch identifies a group of units that share a production or receipt identity. It belongs to one item and can carry manufacturing and expiry dates, supplier, source reference, quantity, and a parent batch. Batch tracking suits material where group-level control is enough, such as lots with a common shelf life.

Batch quantity is derived from stock movement and can be checked for a specific warehouse or across warehouses. Quantity queries apply both Batch access and warehouse access. An unscoped view returns only warehouses visible to the user. The Batch view shows stock by warehouse and can open the stock ledger, move stock, recalculate quantity, or split a lot into a child batch.

The split keeps the parent link and source lot properties. The move and split actions create stock history, so they do not change lot identity without recording a physical movement. For expiry-controlled items, the form derives the expiry date from item shelf life when possible and asks for a date when it cannot derive one. Manufacturing date cannot be later than expiry date.

Batch selection can consider expiry and available quantity. A batched item cannot be moved without a batch when batch tracking is enabled. An outward movement cannot reduce the batch below the allowed quantity unless the batch or stock settings allow that exception. Standard views make active batches in stock and batches with stock that expire soon easy to find.

References: erpnext/…/README.md• L1 erpnext/…/batch.js• L16-64 erpnext/…/batch.js• L66-85 erpnext/…/batch.js• L87-224 erpnext/…/batch.json• L10-37 erpnext/…/batch.py• L162-191 erpnext/…/batch.py• L221-256 erpnext/…/batch.py• L274-445 erpnext/…/test_batch.py• L501-523 erpnext/…/test_batch.py• L985-1006

Serial and batch transaction history

A Serial and Batch Bundle is the transaction-level record that groups serial or batch entries for one item movement. It links those entries to the voucher, voucher row, warehouse, posting time, and direction of movement. The bundle provides one common path for traceability across purchase, sales, stock, manufacturing, and other stock documents. A draft bundle can be filled or replaced through the serial and batch editor, while a submitted bundle is the fixed record used by stock history and valuation.

The bundle checks that identifiers belong to the item, that serial numbers match their batches, and that the total tracked quantity matches the voucher quantity. It also checks the current warehouse for outward movements, the company and voucher row of the stock document, and conflicting future transactions. Returns use the original voucher link to ensure that the returned serial or batch was part of the original movement. Package and rejected quantities are compared in the stock unit that the bundle represents.

Scan and CSV entry can resolve physical numbers to the item. An inward scan can create a missing identifier when the user has the needed permissions. An outward scan still requires an existing identifier. The editor supports incremental changes, search, paging, and CSV export for large draft bundles. A submitted bundle rejects entry changes, and a bundle cannot be reused for a different draft transaction.

When a draft bundle is linked to a voucher, the bundle and its child entries receive the same voucher, row, warehouse, posting time, movement type, and item context. Once submitted, the bundle is immutable and a voucher-linked bundle must be posted with the stock ledger entry for that transaction. This protects the stock ledger, live batch availability, and valuation replay from later changes to its entries. Legacy serial and batch fields remain usable for older ledger records, so returns can still use the original ledger rate when no bundle exists.

When a submitted movement reaches the stock ledger, its quantity changes the warehouse balance. The same movement retains its serial or batch link, so a balance query can answer both “how much is here?” and “which units or lots make up that balance?” Cancellation removes the active link from the ledger and source document without erasing the movement record's history. Valuation replay follows stock-ledger event order. Rates from a purchase unit are converted to the stock unit before rejected material from an in-transit transfer is valued.

References: erpnext/…/serial_and_batch_bundle.json• L42-250 erpnext/…/serial_and_batch_bundle.py• L116-152 erpnext/…/serial_and_batch_bundle.py• L276-380 erpnext/…/serial_and_batch_bundle.py• L409-509 erpnext/…/serial_and_batch_bundle.py• L551-639 erpnext/…/serial_and_batch_bundle.py• L1055-1127 erpnext/…/serial_and_batch_bundle.py• L1178-1209 erpnext/…/serial_and_batch_bundle.py• L1915-1975 erpnext/…/serial_and_batch_bundle.py• L2578-2639 erpnext/…/serial_and_batch_bundle.py• L2766-2811 erpnext/…/test_serial_and_batch_bundle.py• L90-106 erpnext/…/test_serial_and_batch_bundle.py• L1170-1240 erpnext/…/stock_ledger.py• L129-199

Lifecycle tracking

Inventory lifecycle

Physical inventory moves through a small set of business stages. A request states the need. A fulfillment document identifies the planned or actual movement. The stock ledger changes the quantity and warehouse. Serial and batch records preserve the identity of what moved.

For a tracked item, the life cycle is usually:

  1. A reorder policy or demand plan creates a need.
  2. A Material Request records the required quantity and target warehouse.
  3. A purchase, transfer, issue, or work order supplies the material.
  4. A receipt, Stock Entry, or consumption document posts the movement.
  5. The warehouse balance and demand progress update together.
  6. A serial or batch ledger shows the item's later transfers, delivery, return, or use.

Cancellation reverses the stock effect and updates the linked demand. Backdated or conflicting movements can require future stock records to be reposted, and closed stock periods can prevent changes. Serial and batch bundles also reject a movement when a later tracked transaction would make the historical sequence unsafe. These controls keep the current balance consistent with the history that produced it.

References: erpnext/…/material_request.py• L351-439 erpnext/…/mapper.py• L371-521 erpnext/…/mapper.py• L366-403 erpnext/…/pick_list.py• L368-470 erpnext/…/pick_list.py• L540-605 erpnext/…/stock_reservation_entry.py• L144-287 erpnext/…/stock_reservation_entry.py• L2241-2258 erpnext/…/serial_and_batch_bundle.py• L1889-1952 erpnext/…/serial_and_batch_bundle.py• L2766-2811 erpnext/…/stock_ledger.py• L103-199

Replenishment and traceability connect several business areas without making each area own a separate stock truth. Purchasing supplies external material. Manufacturing defines raw-material demand and consumes it. Selling removes stock for a customer. Stock documents post the movement, and the stock ledger remains the shared record of quantity and value.

Use the related pages for the surrounding business views:

References: erpnext/…/stock_controller.py• L187-240 erpnext/…/purchase_receipt.py• L151-199 erpnext/…/delivery_note.py• L160-189 erpnext/…/required_items.py• L360-379

Change checklist

When these files or sections are changed, remember to consider these:

  • Reorder policy fields, projected quantity rules, and automatic Material Request creation must remain aligned. A change in one can silently alter when replenishment starts or how much it requests.
  • Material Request status and quantity links must stay consistent with Purchase Receipt, Pick List, Stock Entry, Production Plan, and Work Order progress fields.
  • Material Request actions must stay aligned with each request type. Supplier selection must keep each purchase row within its pending quantity and preserve supplier grouping when Purchase Orders are created.
  • Warehouse-group scope must continue to report child stock while requests and posted movements use a concrete receiving warehouse.
  • Pick List availability must subtract open Pick List holdings and stock reservations from actual quantity. Its allocation lock must protect concurrent requests on each item.
  • Pick List source selection must preserve serial order, batch choice, work order source-warehouse priority, and item-level links when rows are rebuilt.
  • Manual picking must preserve user-selected locations, quantities, batches, and serial numbers. Automatic allocation must not replace those rows.
  • Pick List transfer progress must remain linked to each Stock Entry row. Partial transfer and cancellation must update the remaining quantity and status.
  • Delivery and transfer mappings from a Pick List must use only pending row quantity and pending serial or batch entries. A moved identifier must not be copied into a later fulfillment document.
  • Product bundle mappings must preserve the picked component warehouse and serial or batch identity. Partial delivery must leave only the undelivered bundle and component quantities pending.
  • Serial and batch identifiers must keep their item, warehouse, voucher-row, quantity, and return links across both legacy fields and Serial and Batch Bundles.
  • Scan and CSV serial or batch entry must keep item and bundle permission checks in place. Missing identifiers must only be created for inward movements.
  • Submitted Serial and Batch Bundles must remain immutable, remain tied to one voucher row and company, and be posted with the submitted transaction. Reusing or changing one can inflate stock or break trace history.
  • Bundle header updates must also refresh the shared voucher, row, warehouse, posting, movement, item, and cancellation fields on child entries when a bundle is linked to a voucher.
  • Bundle quantity checks must use the stock-unit quantity for packages and converted rejected quantities. Accepted and rejected package rows must remain aligned with the voucher quantities.
  • Transit rejected-material valuation must keep rates in the same stock unit as bundle quantities. A purchase-unit rate must not be applied once to each stock-unit quantity.
  • Batch split parent-child links and inherited expiry, manufacturing, supplier, and valuation properties must remain available for the split tree and the related stock history.
  • Batch list views, dashboard quantities, stock moves, and quantity recalculation must use the same movement-derived stock state. Expiry and disabled states must remain clear to users.
  • Batch quantity endpoints must enforce both Batch access and named-warehouse access. Unscoped results must not expose batches in warehouses outside the user's permission scope.
  • Batch move and split actions must create the related stock movement with its serial or batch trace links. They must not change batch identity without changing stock history.
  • Batch expiry rules must remain aligned between the form and server validation. An item with shelf life must not save a batch with an unknown expiry date, and manufacturing date must not be later than expiry date.
  • Serial list views and maintenance status must continue to reflect warehouse state, delivery state, and warranty dates.
  • Stock Reservation Entry status must move with delivery, transfer, consumption, and cancellation. Delivery cancellation must restore the reservation and its serial or batch entry quantities.
  • Pick List cancellation must cancel reservations created from that Pick List. Rate-only source updates must not drop existing reservations.
  • Reservation limits must count stock reserved across warehouses and must not allow a delivery for one source voucher to consume stock held for another.
  • Any stock movement change must preserve both stock-ledger updates and serial or batch history. Otherwise quantity reports and trace reports can disagree.
  • Return and valuation paths must preserve the original ledger rate for legacy serial or batch movements and use stock-ledger order when entries share a posting time.
  • Changes to backdated movement or cancellation rules must account for future serial, batch, ledger, and closed-period checks.

Important failure modes

TriggerConsequenceGuard
Projected quantity reaches the reorder level but the reorder row has no quantity.Automatic replenishment cannot create a useful request.Item validation requires reorder quantity when a reorder level is set.
A Material Request, Pick List, or transfer exceeds the pending Work Order need.Production demand can be fulfilled twice.Pending quantity subtracts transferred, requested, and picked amounts before accepting new demand.
A Material Request maps to a Pick List with manual picking enabled but automatic location selection overwrites the rows.User-selected locations, quantities, batches, or serial numbers can be lost.Pick List creation skips automatic location selection when manual picking is enabled.
An open Pick List or stock reservation already holds stock needed by another Pick List.The new Pick List can overstate free stock or fail later during fulfillment.Availability subtracts open Pick List holdings and active reservation quantities from actual quantity.
A later voucher is mapped from a partly fulfilled Pick List row without checking the submitted vouchers already linked to that row.A serial number can be delivered or transferred twice.Mapping reads the Pick List row's pending quantity and trace entries before creating the next voucher.
A product bundle delivery ignores the picked component warehouse or identifiers.The delivery can use stock from the wrong location or repeat a serial or batch.Bundle mapping carries the picked component context and only the remaining component quantity.
A user requests batch quantity for a warehouse outside the user's access scope.The batch view or picker can expose stock from an unauthorized warehouse or return an unsafe result.Batch quantity access checks Batch selection permission, checks named warehouse permission, and filters unscoped results to visible warehouses.
An outward movement uses a serial number in another warehouse or a delivered serial number.The same unit can appear in two locations or be issued twice.Serial and batch validation checks item, warehouse, status, and inventory availability.
An inward movement repeats an existing serial number without the allowed setting.Unit history no longer identifies one physical unit.Inward bundle validation blocks duplicate serial use.
A batch movement omits its batch or takes more than the batch balance.Lot-level trace and expiry control become unreliable.Bundle validation requires batch data and checks available batch quantity.
A bundle is linked to a new voucher but its child entries keep the old transaction context.Bundle-level trace and entry-level history can disagree.Bundle linkage updates the shared transaction fields on both the bundle and its child entries.
A submitted bundle is changed, reused, or submitted without its voucher's stock posting.Stock quantity, valuation replay, or trace history can be inflated or assigned to the wrong movement.Submitted bundles are immutable, bundle-to-voucher validation rejects reuse, and a linked submitted bundle must have a stock ledger entry.
A scan or CSV entry creates a missing identifier for an outward movement.A movement can refer to a physical identity that does not exist.Identifier resolution creates records only for inward movements.
A package row uses document units while the bundle checks stock units.A valid serial or batch package can be rejected or can record the wrong quantity.Quantity validation converts package and rejected quantities to the units held by the package.
Rejected material from an in-transit transfer uses a purchase-unit rate for stock-unit quantity.The rejected value can be overstated and distort transfer or cost accounts.Transit rates are converted by the row's unit factor before bundle valuation.
A split batch does not retain its parent or source batch properties.The child lot can lose expiry control or its intended valuation and trace link.Split creation copies the source batch properties and posts an outward and inward stock movement.
A return uses a serial or batch that was not part of the original voucher.The return can create stock with a false source history or wrong value.Return validation compares the identifiers with the original voucher bundle or ledger data.
A tracked movement is posted after a later serial or batch transaction.The historical stock sequence cannot be trusted or safely changed.Future-entry validation blocks the movement until the later transaction is resolved.
A batch for an expiry-controlled item has no usable expiry date, or its manufacturing date is later than its expiry date.Users can select stock without a reliable shelf-life boundary.Batch save validation derives the date from shelf life when possible, requires it otherwise, and checks the date order.
A batch quantity becomes stale after stock movements.Batch availability and list status can differ from the stock ledger.The Batch view can recalculate quantity from stock levels before users act on it.
A Delivery Note is cancelled but its reservation stays marked as delivered.Stock reserved for the order is silently released and cannot be delivered again.Delivery cancellation restores the reservation and its serial or batch entry quantities.
A reservation is cancelled after transfer or consumption without closing the source work.Used stock can be released twice or a work order can lose its material link.Work Order reservations with transferred or consumed stock stay in place until the work order is closed or cancelled.

Key files

FileWhy to read it
erpnext/…/reorder_item.pyShows the automatic reorder decision and Material Request creation.
erpnext/…/item_reorder.jsonDefines the warehouse-level reorder policy fields and request types.
erpnext/…/material_request.pyShows demand types, source-order checks, status progress, and links to production and stock fulfillment.
erpnext/…/material_request.jsShows the request-type actions and supplier selection that guide a Material Request to fulfillment documents.
erpnext/…/mapper.pyShows how Material Requests become purchase orders, Stock Entries, and Pick Lists while preserving pending quantities and manual picking choices.
erpnext/…/material_request.pyExplains how planned output becomes raw-material requests.
erpnext/…/required_items.pyShows how manufacturing material demand moves from required to requested, picked, transferred, and consumed.
erpnext/…/pick_list.pyDefines warehouse selection, availability reporting, reservation-aware allocation, trace selection, and partial fulfillment progress.
erpnext/…/mapper.pyShows how picked locations become Delivery Notes or Stock Entries while retaining demand links and pending trace data.
erpnext/…/test_pick_list.pyDemonstrates partial fulfillment, reservation-aware picking, serialized bundles, batch selection, product bundle trace, and warehouse allocation.
erpnext/…/stock_reservation_entry.pyDefines reservation limits, named serial or batch holds, status changes, transfer and consumption use, and cancellation restoration.
erpnext/…/test_stock_reservation_entry.pyDemonstrates delivery, cancellation, unreservation, cross-order protection, and serial or batch reservation behavior.
erpnext/…/stock_entry.pyRepresents the posted movement for transfer, issue, receipt, and manufacture.
erpnext/…/batch.jsShows the batch dashboard, ledger link, quantity recalculation, warehouse move, split action, and expiry-date assistance.
erpnext/…/batch.pyDefines lot identity, expiry rules, movement-derived quantity, warehouse visibility, and split stock movements.
erpnext/…/test_batch.pyDemonstrates batch quantity visibility, warehouse access, expiry behavior, and stock-derived quantity contracts.
erpnext/…/serial_no.pyDefines unit identity, warehouse state, warranty status, and serial availability.
erpnext/…/serial_and_batch_bundle.pyConnects serial or batch entries to stock vouchers, validates trace data, protects draft entry paths, preserves cancellation history, and supports valuation.
erpnext/…/test_serial_and_batch_bundle.pyVerifies bundle identity, immutability, return history, legacy valuation, mixed batch valuation, and safe batch behavior for backdated movements.
erpnext/…/stock_ledger.pyApplies stock movements to warehouse balances and protects historical order.