From ff7ea6a4037f2e71a204cf0cec01552dec74d8b0 Mon Sep 17 00:00:00 2001 From: Suraj Khurana Date: Wed, 15 May 2019 06:15:52 +0000 Subject: [PATCH] Improved: Improved condition in which reversation block was not being executed in case of auto-reserve not found in attribute. (OFBIZ-10518) This should be a case only when system is configured for inventory allocation planning. It was found when some tests were failing and mentioning that reservations not done for items. Thanks: Mathieu Lirzin & Deepak Dixit. git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1859267 13f79535-47bb-0310-9956-ffa450edef68 --- .../main/java/org/apache/ofbiz/order/order/OrderServices.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 c54233e514..9aebe985b4 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 @@ -1204,7 +1204,7 @@ public class OrderServices { continue; } GenericValue orderItem = itemValuesBySeqId.get(orderItemShipGroupAssoc.get("orderItemSeqId")); - if ("SALES_ORDER".equals(orderTypeId) && orderItem != null) { + if ("SALES_ORDER".equals(orderTypeId) && orderItem != null && productStore != null && "Y".equals(productStore.getString("allocateInventory"))) { //If the 'autoReserve' flag is not set for the order item, don't reserve the inventory String autoReserve = OrderReadHelper.getOrderItemAttribute(orderItem, "autoReserve"); if (autoReserve == null || !"true".equals(autoReserve)) {