This is an automated email from the ASF dual-hosted git repository.
jacopoc pushed a commit to branch trunk
in repository https://gitbox.apache.org/repos/asf/ofbiz-framework.git
The following commit(s) were added to refs/heads/trunk by this push:
new 72cf3b9648 Fixed: Incorrect service call for internal requirement may
trigger unnecessary production runs (OFBIZ-13270) (#898)
72cf3b9648 is described below
commit 72cf3b9648e2952df7f26783438877577507e2e2
Author: Jacopo Cappellato <[email protected]>
AuthorDate: Wed Jun 25 11:14:24 2025 +0200
Fixed: Incorrect service call for internal requirement may trigger
unnecessary production runs (OFBIZ-13270) (#898)
When an internal requirement is approved, a production run should be
automatically created to fulfill it. Previously, the system invoked a
special service (createProductionRunsForProductBom) instead of the
standard one (createProductionRun). As a result, the system not only
created the production run for the required product, but also additional
runs for all its sub-assemblies, even if those sub-assemblies were
already available in the warehouse or had existing requirements in the
system.
---
.../apache/ofbiz/manufacturing/jobshopmgt/ProductionRunServices.java | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git
a/applications/manufacturing/src/main/java/org/apache/ofbiz/manufacturing/jobshopmgt/ProductionRunServices.java
b/applications/manufacturing/src/main/java/org/apache/ofbiz/manufacturing/jobshopmgt/ProductionRunServices.java
index 07873c07a6..805164ed27 100644
---
a/applications/manufacturing/src/main/java/org/apache/ofbiz/manufacturing/jobshopmgt/ProductionRunServices.java
+++
b/applications/manufacturing/src/main/java/org/apache/ofbiz/manufacturing/jobshopmgt/ProductionRunServices.java
@@ -2531,7 +2531,7 @@ public class ProductionRunServices {
Map<String, Object> serviceContext = new HashMap<>();
serviceContext.clear();
serviceContext.put("productId", requirement.getString("productId"));
- serviceContext.put("quantity", quantity);
+ serviceContext.put("pRQuantity", quantity);
serviceContext.put("startDate",
requirement.getTimestamp("requirementStartDate"));
serviceContext.put("facilityId", requirement.getString("facilityId"));
String workEffortName = null;
@@ -2547,7 +2547,7 @@ public class ProductionRunServices {
serviceContext.put("userLogin", userLogin);
Map<String, Object> serviceResult = null;
try {
- serviceResult =
dispatcher.runSync("createProductionRunsForProductBom", serviceContext);
+ serviceResult = dispatcher.runSync("createProductionRun",
serviceContext);
if (ServiceUtil.isError(serviceResult)) {
return
ServiceUtil.returnError(UtilProperties.getMessage(RESOURCE,
"ManufacturingProductionRunNotCreated", locale)
+ ": " + ServiceUtil.getErrorMessage(serviceResult));