diff --git a/applications/manufacturing/servicedef/services_production_run.xml b/applications/manufacturing/servicedef/services_production_run.xml
index 3e2a517f8a..0dfb99a6f4 100644
--- a/applications/manufacturing/servicedef/services_production_run.xml
+++ b/applications/manufacturing/servicedef/services_production_run.xml
@@ -56,8 +56,8 @@ under the License.
location="org.ofbiz.manufacturing.jobshopmgt.ProductionRunServices" invoke="updateProductionRun" auth="true">
Update a Production Run
-
-
+
+
diff --git a/applications/manufacturing/src/org/ofbiz/manufacturing/jobshopmgt/ProductionRunServices.java b/applications/manufacturing/src/org/ofbiz/manufacturing/jobshopmgt/ProductionRunServices.java
index f6040c0425..28ffa83f49 100644
--- a/applications/manufacturing/src/org/ofbiz/manufacturing/jobshopmgt/ProductionRunServices.java
+++ b/applications/manufacturing/src/org/ofbiz/manufacturing/jobshopmgt/ProductionRunServices.java
@@ -1067,13 +1067,7 @@ public class ProductionRunServices {
LocalDispatcher dispatcher = ctx.getDispatcher();
Locale locale = (Locale) context.get("locale");
GenericValue userLogin = (GenericValue) context.get("userLogin");
- /* TODO: security management and finishing cleaning (ex copy from PartyServices.java)
- if (!security.hasEntityPermission(secEntity, secOperation, userLogin)) {
- result.put(ModelService.RESPONSE_MESSAGE, ModelService.RESPOND_ERROR);
- result.put(ModelService.ERROR_MESSAGE, "You do not have permission to perform this operation for this party");
- return partyId;
- }
- */
+
String productionRunId = (String) context.get("productionRunId");
String routingTaskId = (String) context.get("routingTaskId");
if (! UtilValidate.isEmpty(productionRunId) && ! UtilValidate.isEmpty(routingTaskId)) {
@@ -1088,7 +1082,11 @@ public class ProductionRunServices {
Timestamp estimatedStartDate = (Timestamp) context.get("estimatedStartDate");
Timestamp pRestimatedStartDate = productionRun.getEstimatedStartDate();
if (pRestimatedStartDate.after(estimatedStartDate)) {
- return ServiceUtil.returnError(UtilProperties.getMessage(resource, "ManufacturingRoutingTaskStartDateBeforePRun", locale));
+ try {
+ Map resultService = dispatcher.runSync("updateProductionRun", UtilMisc.toMap("productionRunId", productionRunId, "estimatedStartDate", estimatedStartDate, "userLogin", userLogin));
+ } catch (GenericServiceException e) {
+ return ServiceUtil.returnError(UtilProperties.getMessage(resource, "ManufacturingRoutingTaskStartDateBeforePRun", locale));
+ }
}
Long priority = (Long) context.get("priority");