This is an automated email from the ASF dual-hosted git repository. pawan pushed a commit to branch release17.12 in repository https://gitbox.apache.org/repos/asf/ofbiz-framework.git
The following commit(s) were added to refs/heads/release17.12 by this push: new 673fddf Fixed: productServiceOrder-test issue, it has been introduced after we fixed InventoryItemStatus is not updated to INV_PROMISED status(OFBIZ-8459) 673fddf is described below commit 673fddf72b90131020adee955393b0c0882cbd1d Author: Pawan Verma <pawan.ve...@hotwaxsystems.com> AuthorDate: Thu May 28 19:58:27 2020 +0530 Fixed: productServiceOrder-test issue, it has been introduced after we fixed InventoryItemStatus is not updated to INV_PROMISED status(OFBIZ-8459) Thanks, Jacques for the report. --- .../src/main/java/org/apache/ofbiz/order/order/OrderServices.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/applications/order/src/main/java/org/apache/ofbiz/order/order/OrderServices.java b/applications/order/src/main/java/org/apache/ofbiz/order/order/OrderServices.java index f40348a..4590127 100644 --- a/applications/order/src/main/java/org/apache/ofbiz/order/order/OrderServices.java +++ b/applications/order/src/main/java/org/apache/ofbiz/order/order/OrderServices.java @@ -1033,6 +1033,7 @@ public class OrderServices { delegator.storeAll(toBeStored); List<String> resErrorMessages = new LinkedList<>(); + GenericValue permUserLogin = EntityQuery.use(delegator).from("UserLogin").where("userLoginId", "system").cache().queryOne(); // add a product service to inventory if (UtilValidate.isNotEmpty(orderItems)) { @@ -1066,14 +1067,13 @@ public class OrderServices { Map<String, Object> ripCtx = new HashMap<>(); if (UtilValidate.isNotEmpty(inventoryFacilityId) && UtilValidate.isNotEmpty(productId) && orderItem.getBigDecimal("quantity").compareTo(BigDecimal.ZERO) > 0) { - // do something tricky here: run as the "system" user - GenericValue permUserLogin = EntityQuery.use(delegator).from("UserLogin").where("userLoginId", "system").cache().queryOne(); ripCtx.put("productId", productId); ripCtx.put("facilityId", inventoryFacilityId); ripCtx.put("inventoryItemTypeId", "SERIALIZED_INV_ITEM"); ripCtx.put("statusId","INV_AVAILABLE"); ripCtx.put("quantityAccepted", orderItem.getBigDecimal("quantity")); ripCtx.put("quantityRejected", 0.0); + // do something tricky here: run as the "system" user ripCtx.put("userLogin", permUserLogin); try { Map<String, Object> ripResult = dispatcher.runSync("receiveInventoryProduct", ripCtx); @@ -1093,7 +1093,7 @@ public class OrderServices { // START inventory reservation try { - reserveInventory(delegator, dispatcher, userLogin, locale, orderItemShipGroupInfo, dropShipGroupIds, itemValuesBySeqId, + reserveInventory(delegator, dispatcher, permUserLogin, locale, orderItemShipGroupInfo, dropShipGroupIds, itemValuesBySeqId, orderTypeId, productStoreId, resErrorMessages); } catch (GeneralException e) { return ServiceUtil.returnError(e.getMessage());