Skip to content

OFBIZ-13262: Added inventory reservation logic for production run tasks in manufacturing and also improved inventory issuance feature that works with reservations#1168

Open
diveshdut wants to merge 4 commits intoapache:trunkfrom
diveshdut:feature/create-production-run-reservations
Open

OFBIZ-13262: Added inventory reservation logic for production run tasks in manufacturing and also improved inventory issuance feature that works with reservations#1168
diveshdut wants to merge 4 commits intoapache:trunkfrom
diveshdut:feature/create-production-run-reservations

Conversation

@diveshdut
Copy link
Copy Markdown
Contributor

(OFBIZ-13262)

This PR introduces formal Inventory Reservation capabilities to the Manufacturing module. Previously, production components were largely tracked via direct issuance; this enhancement allows the system to reserve components ahead of physical issuance, bringing manufacturing parity with Sales Order fulfillment workflows.

User Workflow & UI Journey

  1. Creation & Planning: A Production Run is created with estimated component requirements.

  2. Formal Commitment (Approval): Upon changing the status to Printed or Approved, the system automatically triggers the reservation engine (if setting is enabled)

  3. UI Impact: The "Components" screen now displays a "Reserved" column and a "Backordered" field for shortages.

  4. Seamless Issuance: When the user clicks "Issue Component," the system automatically consumes the existing reservations first, ensuring that reserved lots or batches are accurately tracked through the issuance process. If no reservations are available, then system issues inventory.

  5. "Force Issue" (Break-Glass Logic): In cases where reservations are not available (e.g., emergency jobs or stock discrepancies), the user can still perform a "Force Issue." This allows physical issuance to proceed regardless of the reservation state, ensuring that the production line never stops due to administrative blockers.

  6. Automated Recovery: Any remaining backorders in the reservation ledger are automatically satisfied as soon as new stock is received in the warehouse.

New Data Model: WorkEffortInvRes

A new table, WorkEffortInvRes (Inventory Reservation for WorkEffort), has been introduced as the core ledger for this feature.

  • Purpose: It tracks "soft" commitments of materials to production tasks.

  • Backorder Support: Through the quantityNotAvailable field, it explicitly tracks "Global Debt" or backordered units, allowing the system to know exactly what is owed to the production line.

  • Auditability: It stores reservation timestamps and strategy enums (FIFO/LIFO), providing a full audit trail of how and when materials were committed.

New Policy Controls (Facility Settings)

To support diverse warehouse operations, three new flags have been introduced to the Facility entity:

  1. autoReservePrun (Y/N): Controls the entry point of the reservation lifecycle. If enabled, the system automatically invokes autoReserveWorkEffortInventory whenever a production run reaches the Approved or Printed status.

  2. allowInventoryTheft (Y/N): Determines if a production task can "claim" reservations currently held by another task. Essential for high-priority production in fluid environments.

  3. reconcilePrunBackorders (Y/N): Enables real-time backorder fulfillment. When inventory is received, the system proactively reserves it for pending production tasks.

Core Services Added:

  1. autoReserveWorkEffortInventory: Triggers when autoReservePrun in Facility is set to Y. Provides high-level automation by orchestrating the reservation of all components required for a production run. It evaluates current facility inventory levels and automatically generates WorkEffortInvRes records to secure materials.

  2. reserveWorkEffortInventoryItem: Allows for granular, item-specific commitments. Users can explicitly reserve a particular InventoryItem (e.g., a specific batch or lot) against a production task, bypassing the automated selection logic.

  3. reallocateAndIssueInventory: The primary engine for transition. It manages the logic of converting existing reservations into physical issuance. It also handles "Move-Then-Issue" strategies, allowing reservations to be reallocated between tasks if required by the facility's fluidity policies. Depends on allowInventoryTheft flag of Facility.

  4. releaseProductionRunTaskComponent: Handles the cleanup of commitments. When a task is cancelled or a component is no longer needed, this service releases the reservation and ensures that the ATP (Available to Promise) balance is immediately restored across the facility.

  5. reassignWorkEffortInventoryReservations: The Backorder Satisfier: Automatically fulfills backordered production tasks (quantityNotAvailable in WorkEffortInvRes) when new inventory is received or released.

  6. reconcileGlobalReservations: The Public Auditor: The top-level service used to audit and reconcile inventory state. It ensures that any "Global Debt" (reservations without an item ID) is correctly localized to physical stock as soon as it becomes available.

  7. trinitySync: The Integrity Guard: Performs real-time recalculation of availableToPromiseTotal by comparing physical stock against active reservations in WorkEffortInvRes and OrderItemShipGrpInvRes.

Real-time Automation (SECA)

To ensure a seamless user experience, several Service ECA (SECA) triggers have been introduced:

  • Approval Trigger: Automatically invokes autoReserveWorkEffortInventory when a production run status changes to Printed/Approved, ensuring stock is secured the moment a job is confirmed.

  • Receipt Satisfaction: Automatically invokes reassignWorkEffortInventoryReservations whenever inventory levels increase (via balanceInventoryItems), immediately satisfying any pending production backorders.

The primary objective is to allow production tasks to commit inventory early in the production lifecycle. This ensures that critical materials are "locked" for specific jobs, preventing stockouts and enabling more accurate Material Requirements Planning (MRP) and Available-to-Promise (ATP) calculations.

Business Impact

  • Accurate Material Planning: MRP and ATP calculations now reflect true manufacturing commitments, preventing component "hoarding" and stockouts.

  • Zero-Touch Fulfillment: Production backorders are satisfied automatically upon stock receipt, reducing manual intervention from warehouse managers.

  • Policy Flexibility: Facility managers can choose between strict reservation models or fluid environments where high-priority jobs can "steal" stock from others.

At a high level, this new inventory reservation framework delivers five critical business benefits:

  1. Guaranteed Material Availability: By formally "locking" components for specific production tasks, the system prevents stockouts and ensures that materials are physically waiting for the production line when needed.

  2. Reduced Production Lead Times: The automated backorder fulfillment logic removes manual intervention from the warehouse. As soon as missing stock arrives, it is instantly committed to the waiting production job, accelerating the entire manufacturing cycle.

  3. Physical-to-Ledger Integrity: The "Trinity of Truth" synchronization ensures that your warehouse floor always matches your financial books. This eliminates "ghost inventory" and significantly reduces the time spent on manual inventory audits and corrections.

  4. Strategic Operational Agility: New facility-level policies allow management to prioritize critical production runs. High-priority jobs can automatically secure materials from lower-priority tasks, ensuring that key customer deadlines are always met.

  5. Proactive Shortage Visibility: Floor managers gain real-time visibility into material blockers. By identifying backorders at the planning stage rather than the issuance stage, the organization can proactively resolve shortages before they stop the production line.

In essence, these features move the organization from reactive inventory tracking to proactive material commitment, directly increasing manufacturing reliability and throughput.

diveshdut added 4 commits May 6, 2026 14:44
…l-time reconciliation, introduced a robust framework for managing inventory reservations and physical issuance in the manufacturing process.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant