Fixed a bug where some SECA services were assuming an optional OrderHeader field was always non-null.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1207091 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
@@ -211,6 +211,10 @@ public class RequirementServices {
|
||||
try {
|
||||
GenericValue order = delegator.findByPrimaryKey("OrderHeader", UtilMisc.toMap("orderId", orderId));
|
||||
GenericValue productStore = order.getRelatedOneCache("ProductStore");
|
||||
if (productStore == null) {
|
||||
Debug.logInfo("ProductStore for order ID " + orderId + " not found, requirements not created", module);
|
||||
return ServiceUtil.returnSuccess();
|
||||
}
|
||||
String facilityId = productStore.getString("inventoryFacilityId");
|
||||
List<GenericValue> orderItems = order.getRelated("OrderItem");
|
||||
for (Iterator<GenericValue> iter = orderItems.iterator(); iter.hasNext();) {
|
||||
@@ -267,6 +271,10 @@ public class RequirementServices {
|
||||
try {
|
||||
GenericValue order = delegator.findByPrimaryKey("OrderHeader", UtilMisc.toMap("orderId", orderId));
|
||||
GenericValue productStore = order.getRelatedOneCache("ProductStore");
|
||||
if (productStore == null) {
|
||||
Debug.logInfo("ProductStore for order ID " + orderId + " not found, ATP requirements not created", module);
|
||||
return ServiceUtil.returnSuccess();
|
||||
}
|
||||
String facilityId = productStore.getString("inventoryFacilityId");
|
||||
List<GenericValue> orderItems = order.getRelated("OrderItem");
|
||||
for (Iterator<GenericValue> iter = orderItems.iterator(); iter.hasNext();) {
|
||||
|
||||
Reference in New Issue
Block a user