You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@ofbiz.apache.org by "Divesh Dutta (Jira)" <ji...@apache.org> on 2026/07/21 09:30:00 UTC
[jira] [Created] (OFBIZ-13459) Preserve known facility context on MRP events generated by the OFBiz MRP engine
Divesh Dutta created OFBIZ-13459:
------------------------------------
Summary: Preserve known facility context on MRP events generated by the OFBiz MRP engine
Key: OFBIZ-13459
URL: https://issues.apache.org/jira/browse/OFBIZ-13459
Project: OFBiz
Issue Type: Improvement
Components: manufacturing
Affects Versions: Upcoming Branch
Reporter: Divesh Dutta
Assignee: Divesh Dutta
Fix For: Upcoming Branch
The OFBiz MRP engine can generate {{MrpEvent}} rows without {{facilityId}} even when the engine already has reliable facility context while processing the source planning signal.
This proposal is intended as a traceability improvement, not as a change to MRP calculation logic, event identity, or event merge behavior.
In several MRP event creation paths, OFBiz already knows the relevant facility from source data or from the current planning context, but that context is not always preserved on the generated {{{}MrpEvent{}}}. This makes planner-facing timelines, exception analysis, and proposed supply interpretation harder to trust, especially for multi-warehouse and warehouse/plant-aware planning.
Examples of where facility context is already available include:
* sales order demand records
* approved requirements
* purchase supply processed in the current planning warehouse context
* production run demand and receipt
* {{{}ProductFacility{}}}-driven minimum stock signals
* component requirement events generated during BOM explosion
* proposed purchase and manufacturing supply events
* facility-specific MRP error events
Proposed rule:
* stamp {{facilityId}} on {{MrpEvent}} only when the OFBiz MRP engine already has a meaningful facility from source data or the current run context
* if the source signal is organization-level or has no reliable facility context, keep {{facilityId}} empty
Expected scope of the change:
* preserve source/query facility for {{SALES_ORDER_SHIP}}
* preserve requirement facility for {{PROD_REQ_RECP}}
* preserve the current planning warehouse for {{PUR_ORDER_RECP}}
* preserve production facility for {{MANUF_ORDER_REQ}} and {{MANUF_ORDER_RECP}}
* preserve {{ProductFacility.facilityId}} for {{REQUIRED_MRP}}
* preserve manufacturing facility for {{MRP_REQUIREMENT}} generated during BOM explosion
* preserve warehouse/manufacturing facility for {{PROP_PUR_O_RECP}} and {{PROP_MANUF_O_RECP}}
* preserve facility on {{ERROR}} events when the failing planning context is facility-specific
* conservatively backfill {{facilityId}} during {{MrpEvent}} merge only when the existing row has no facility and the incoming update provides one
Important non-goals:
* no change to MRP quantity calculation
* no change to {{MrpEvent}} primary key
* no change to {{MrpEvent}} merge semantics
* no forced facility assignment for organization-level events
* no change to late-flag logic
* no run-log or planner API changes as part of this ticket
Additional note on {{{}facilityGroupId{}}}:
* when MRP is launched with {{{}facilityGroupId{}}}, current code resolves that group into concrete run facilities before event creation
* this ticket would preserve those resolved facilities on the generated events, not the facility group id itself
Planner-facing benefits:
* better product-plus-facility event traceability
* clearer understanding of which warehouse or plant an event belongs to
* better support for downstream API/UI consumers
* less ambiguous interpretation of proposed supply and exception events
--
This message was sent by Atlassian Jira
(v8.20.10#820010)