svn commit: r1351866 [20/48] - in /ofbiz/branches/20120329_portletWidget: ./ applications/accounting/ applications/accounting/config/ applications/accounting/data/ applications/accounting/entitydef/ applications/accounting/script/org/ofbiz/accounting/i...

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

svn commit: r1351866 [20/48] - in /ofbiz/branches/20120329_portletWidget: ./ applications/accounting/ applications/accounting/config/ applications/accounting/data/ applications/accounting/entitydef/ applications/accounting/script/org/ofbiz/accounting/i...

erwan
Modified: ofbiz/branches/20120329_portletWidget/applications/order/src/org/ofbiz/order/order/OrderServices.java
URL: http://svn.apache.org/viewvc/ofbiz/branches/20120329_portletWidget/applications/order/src/org/ofbiz/order/order/OrderServices.java?rev=1351866&r1=1351865&r2=1351866&view=diff
==============================================================================
--- ofbiz/branches/20120329_portletWidget/applications/order/src/org/ofbiz/order/order/OrderServices.java (original)
+++ ofbiz/branches/20120329_portletWidget/applications/order/src/org/ofbiz/order/order/OrderServices.java Tue Jun 19 21:36:11 2012
@@ -152,8 +152,7 @@ public class OrderServices {
                     // check sales agent/customer relationship
                     List<GenericValue> repsCustomers = new LinkedList<GenericValue>();
                     try {
-                        repsCustomers = EntityUtil.filterByDate(userLogin.getRelatedOne("Party").getRelatedByAnd("FromPartyRelationship",
-                                UtilMisc.toMap("roleTypeIdFrom", "AGENT", "roleTypeIdTo", "CUSTOMER", "partyIdTo", partyId)));
+                        repsCustomers = EntityUtil.filterByDate(userLogin.getRelatedOne("Party", false).getRelated("FromPartyRelationship", UtilMisc.toMap("roleTypeIdFrom", "AGENT", "roleTypeIdTo", "CUSTOMER", "partyIdTo", partyId), null, false));
                     } catch (GenericEntityException ex) {
                         Debug.logError("Could not determine if " + partyId + " is a customer of user " + userLogin.getString("userLoginId") + " due to " + ex.getMessage(), module);
                     }
@@ -163,8 +162,7 @@ public class OrderServices {
                     if (!hasPermission) {
                         // check sales sales rep/customer relationship
                         try {
-                            repsCustomers = EntityUtil.filterByDate(userLogin.getRelatedOne("Party").getRelatedByAnd("FromPartyRelationship",
-                                    UtilMisc.toMap("roleTypeIdFrom", "SALES_REP", "roleTypeIdTo", "CUSTOMER", "partyIdTo", partyId)));
+                            repsCustomers = EntityUtil.filterByDate(userLogin.getRelatedOne("Party", false).getRelated("FromPartyRelationship", UtilMisc.toMap("roleTypeIdFrom", "SALES_REP", "roleTypeIdTo", "CUSTOMER", "partyIdTo", partyId), null, false));
                         } catch (GenericEntityException ex) {
                             Debug.logError("Could not determine if " + partyId + " is a customer of user " + userLogin.getString("userLoginId") + " due to " + ex.getMessage(), module);
                         }
@@ -686,7 +684,7 @@ public class OrderServices {
                 // see if this fixed asset has a calendar, when no create one and attach to fixed asset
                 Debug.logInfo("find the techdatacalendar",module);
                 GenericValue techDataCalendar = null;
-                try { techDataCalendar = fixedAsset.getRelatedOne("TechDataCalendar");
+                try { techDataCalendar = fixedAsset.getRelatedOne("TechDataCalendar", false);
                 }
                 catch (GenericEntityException e) {
                     Debug.logInfo("TechData calendar does not exist yet so create for fixedAsset: " + fixedAsset.get("fixedAssetId") ,module);
@@ -924,9 +922,8 @@ public class OrderServices {
         // store the orderProductPromoCodes
         Set<String> orderProductPromoCodes = UtilGenerics.checkSet(context.get("orderProductPromoCodes"));
         if (UtilValidate.isNotEmpty(orderProductPromoCodes)) {
-            GenericValue orderProductPromoCode = delegator.makeValue("OrderProductPromoCode");
             for(String productPromoCodeId : orderProductPromoCodes) {
-                orderProductPromoCode.clear();
+                GenericValue orderProductPromoCode = delegator.makeValue("OrderProductPromoCode");
                 orderProductPromoCode.set("orderId", orderId);
                 orderProductPromoCode.set("productPromoCodeId", productPromoCodeId);
                 toBeStored.add(orderProductPromoCode);
@@ -1078,7 +1075,7 @@ public class OrderServices {
             if (UtilValidate.isNotEmpty(orderItems)) {
                 for (GenericValue orderItem: orderItems) {
                     String productId = (String) orderItem.get("productId");
-                    GenericValue product = delegator.getRelatedOne("Product", orderItem);
+                    GenericValue product = delegator.getRelatedOne("Product", orderItem, false);
                     
                     if (product != null && ("SERVICE_PRODUCT".equals(product.get("productTypeId")) || "AGGREGATEDSERV_CONF".equals(product.get("productTypeId")))) {
                         String inventoryFacilityId = null;
@@ -1093,9 +1090,9 @@ public class OrderServices {
                             GenericValue productFacility = null;
 
                             try {
-                                productFacilities = delegator.getRelatedCache("ProductFacility", product);
+                                productFacilities = product.getRelated("ProductFacility", product, null, true);
                             } catch (GenericEntityException e) {
-                                Debug.logWarning(e, "Error invoking getRelatedCache in isCatalogInventoryAvailable", module);
+                                Debug.logWarning(e, "Error invoking getRelated in isCatalogInventoryAvailable", module);
                             }
 
                             if (UtilValidate.isNotEmpty(productFacilities)) {
@@ -1184,7 +1181,7 @@ public class OrderServices {
                         continue;
                     }
                     GenericValue orderItem = itemValuesBySeqId.get(orderItemShipGroupAssoc.get("orderItemSeqId"));
-                    GenericValue orderItemShipGroup = orderItemShipGroupAssoc.getRelatedOne("OrderItemShipGroup");
+                    GenericValue orderItemShipGroup = orderItemShipGroupAssoc.getRelatedOne("OrderItemShipGroup", false);
                     String shipGroupFacilityId = orderItemShipGroup.getString("facilityId");
                     String itemStatus = orderItem.getString("statusId");
                     if ("ITEM_REJECTED".equals(itemStatus) || "ITEM_CANCELLED".equals(itemStatus) || "ITEM_COMPLETED".equals(itemStatus)) {
@@ -1195,7 +1192,7 @@ public class OrderServices {
                             !"RENTAL_ORDER_ITEM".equals(orderItem.getString("orderItemTypeId"))) {  // ignore for rental
                         try {
                             // get the product of the order item
-                            GenericValue product = orderItem.getRelatedOne("Product");
+                            GenericValue product = orderItem.getRelatedOne("Product", false);
                             if (product == null) {
                                 Debug.logError("Error when looking up product in reserveInventory service", module);
                                 resErrorMessages.add("Error when looking up product in reserveInventory service");
@@ -1290,7 +1287,7 @@ public class OrderServices {
                     if (UtilValidate.isNotEmpty(orderItem.getString("productId")) && "RENTAL_ORDER_ITEM".equals(orderItem.getString("orderItemTypeId"))) {
                         try {
                             // get the product of the order item
-                            GenericValue product = orderItem.getRelatedOne("Product");
+                            GenericValue product = orderItem.getRelatedOne("Product", false);
                             if (product == null) {
                                 Debug.logError("Error when looking up product in reserveInventory service", module);
                                 resErrorMessages.add("Error when looking up product in reserveInventory service");
@@ -2030,7 +2027,7 @@ public class OrderServices {
             for(GenericValue orderItemShipGroupAssoc : orderItemShipGroupAssocs) {
                 GenericValue orderItem = null;
                 try {
-                    orderItem = orderItemShipGroupAssoc.getRelatedOne("OrderItem");
+                    orderItem = orderItemShipGroupAssoc.getRelatedOne("OrderItem", false);
                 } catch (GenericEntityException e) {
                     Debug.logError(e, module);
                 }
@@ -2255,6 +2252,7 @@ public class OrderServices {
         GenericValue userLogin = (GenericValue) context.get("userLogin");
         String orderId = (String) context.get("orderId");
         String statusId = (String) context.get("statusId");
+        String changeReason = (String) context.get("changeReason");
         Map<String, Object> successResult = ServiceUtil.returnSuccess();
         Locale locale = (Locale) context.get("locale");
 
@@ -2307,6 +2305,7 @@ public class OrderServices {
             orderStatus.put("orderId", orderId);
             orderStatus.put("statusDatetime", UtilDateTime.nowTimestamp());
             orderStatus.put("statusUserLogin", userLogin.getString("userLoginId"));
+            orderStatus.put("changeReason", changeReason);
 
             orderHeader.store();
             orderStatus.create();
@@ -2690,7 +2689,7 @@ public class OrderServices {
         List<GenericValue> assignments = null;
         if (workEffort != null) {
             try {
-                assignments = workEffort.getRelated("WorkEffortPartyAssignment");
+                assignments = workEffort.getRelated("WorkEffortPartyAssignment", null, null, false);
             } catch (GenericEntityException e1) {
                 Debug.logError(e1, "Problems getting assignements", module);
             }
@@ -2867,12 +2866,11 @@ public class OrderServices {
         }
         for (int i = 0; i < purpose.length; i++) {
             try {
-                GenericValue orderContactMech = EntityUtil.getFirst(orderHeader.getRelatedByAnd("OrderContactMech",
-                            UtilMisc.toMap("contactMechPurposeTypeId", purpose[i])));
-                GenericValue contactMech = orderContactMech.getRelatedOne("ContactMech");
+                GenericValue orderContactMech = EntityUtil.getFirst(orderHeader.getRelated("OrderContactMech", UtilMisc.toMap("contactMechPurposeTypeId", purpose[i]), null, false));
+                GenericValue contactMech = orderContactMech.getRelatedOne("ContactMech", false);
 
                 if (contactMech != null) {
-                    result.put(outKey[i], contactMech.getRelatedOne("PostalAddress"));
+                    result.put(outKey[i], contactMech.getRelatedOne("PostalAddress", false));
                 }
             } catch (GenericEntityException e) {
                 result.put(ModelService.RESPONSE_MESSAGE, ModelService.RESPOND_ERROR);
@@ -3023,7 +3021,7 @@ public class OrderServices {
                 // need the store for the order
                 GenericValue productStore = null;
                 try {
-                    productStore = orderHeader.getRelatedOne("ProductStore");
+                    productStore = orderHeader.getRelatedOne("ProductStore", false);
                 } catch (GenericEntityException e) {
                     Debug.logError(e, "Unable to get ProductStore from OrderHeader", module);
                 }
@@ -3121,7 +3119,7 @@ public class OrderServices {
         List<GenericValue> orderItems = null;
         if (orderHeader != null) {
             try {
-                orderItems = orderHeader.getRelated("OrderItem");
+                orderItems = orderHeader.getRelated("OrderItem", null, null, false);
             } catch (GenericEntityException e) {
                 Debug.logError(e, "ERROR: Unable to get OrderItem list for orderId : " + orderId, module);
                 return ServiceUtil.returnError(UtilProperties.getMessage(resource_error,
@@ -3138,14 +3136,14 @@ public class OrderServices {
             for(GenericValue item : orderItems) {
                 GenericValue product = null;
                 try {
-                    product = item.getRelatedOne("Product");
+                    product = item.getRelatedOne("Product", false);
                 } catch (GenericEntityException e) {
                     Debug.logError(e, "ERROR: Unable to get Product from OrderItem", module);
                 }
                 if (product != null) {
                     GenericValue productType = null;
                     try {
-                        productType = product.getRelatedOne("ProductType");
+                        productType = product.getRelatedOne("ProductType", false);
                     } catch (GenericEntityException e) {
                         Debug.logError(e, "ERROR: Unable to get ProductType from Product", module);
                     }
@@ -3218,7 +3216,7 @@ public class OrderServices {
 
                     if (product != null) {
                         try {
-                            productType = product.getRelatedOne("ProductType");
+                            productType = product.getRelatedOne("ProductType", false);
                         } catch (GenericEntityException e) {
                             Debug.logError(e, "ERROR: Unable to get ProductType from Product", module);
                         }
@@ -3296,13 +3294,13 @@ public class OrderServices {
                 GenericValue product = null;
                 List<GenericValue> productContent = null;
                 try {
-                    product = orderItem.getRelatedOne("Product");
+                    product = orderItem.getRelatedOne("Product", false);
                     if (product == null) {
                         return ServiceUtil.returnError(UtilProperties.getMessage(resource_error,
                                 "OrderErrorCannotCheckForFulfillmentProductNotFound", locale));
                     }
 
-                    List<GenericValue> allProductContent = product.getRelated("ProductContent");
+                    List<GenericValue> allProductContent = product.getRelated("ProductContent", null, null, false);
 
                     // try looking up the parent product if the product has no content and is a variant
                     if (UtilValidate.isEmpty(allProductContent) && ("Y".equals(product.getString("isVariant")))) {
@@ -3311,7 +3309,7 @@ public class OrderServices {
                             allProductContent = FastList.newInstance();
                         }
                         if (parentProduct != null) {
-                            allProductContent.addAll(parentProduct.getRelated("ProductContent"));
+                            allProductContent.addAll(parentProduct.getRelated("ProductContent", null, null, false));
                         }
                     }
 
@@ -3331,7 +3329,7 @@ public class OrderServices {
                     for(GenericValue productContentItem : productContent) {
                         GenericValue content = null;
                         try {
-                            content = productContentItem.getRelatedOne("Content");
+                            content = productContentItem.getRelatedOne("Content", false);
                         } catch (GenericEntityException e) {
                             Debug.logError(e,"ERROR: Cannot get Content entity: " + e.getMessage(),module);
                             continue;
@@ -3407,7 +3405,7 @@ public class OrderServices {
             for(GenericValue item : orderItems) {
                 GenericValue product = null;
                 try {
-                    product = item.getRelatedOne("Product");
+                    product = item.getRelatedOne("Product", false);
                 } catch (GenericEntityException e) {
                     Debug.logError(e, "ERROR: Unable to get Product from OrderItem", module);
                 }
@@ -4431,14 +4429,14 @@ public class OrderServices {
             }
 
             // get the order header
-            GenericValue orderHeader = orderPaymentPreference.getRelatedOne("OrderHeader");
+            GenericValue orderHeader = orderPaymentPreference.getRelatedOne("OrderHeader", false);
             if (orderHeader == null) {
                 return ServiceUtil.returnError(UtilProperties.getMessage(resource,
                         "OrderOrderPaymentCannotBeCreatedWithRelatedOrderHeader", locale));
             }
 
             // get the store for the order.  It will be used to set the currency
-            GenericValue productStore = orderHeader.getRelatedOne("ProductStore");
+            GenericValue productStore = orderHeader.getRelatedOne("ProductStore", false);
             if (productStore == null) {
                 return ServiceUtil.returnError(UtilProperties.getMessage(resource,
                         "OrderOrderPaymentCannotBeCreatedWithRelatedProductStore", locale));
@@ -4965,7 +4963,7 @@ public class OrderServices {
 
             // Build a map of productId -> quantity cancelled over all order items
             Map<String, Object> productRequirementQuantities = new HashMap<String, Object>();
-            List<GenericValue> orderItems = orderHeader.getRelated("OrderItem");
+            List<GenericValue> orderItems = orderHeader.getRelated("OrderItem", null, null, false);
             for(GenericValue orderItem : orderItems) {
                 if (! "PRODUCT_ORDER_ITEM".equals(orderItem.getString("orderItemTypeId"))) continue;
 
@@ -5035,7 +5033,7 @@ public class OrderServices {
                 return ServiceUtil.returnError(errorMessage);
             }
 
-            List<GenericValue> orderItems = orderHeader.getRelated("OrderItem");
+            List<GenericValue> orderItems = orderHeader.getRelated("OrderItem", null, null, false);
             for(GenericValue orderItem : orderItems) {
                 if (! "PRODUCT_ORDER_ITEM".equals(orderItem.getString("orderItemTypeId"))) continue;
 
@@ -5050,7 +5048,7 @@ public class OrderServices {
                 }
 
                 // Get the received quantity for the order item - ignore the quantityRejected, since rejected items should be reordered
-                List<GenericValue> shipmentReceipts = orderItem.getRelated("ShipmentReceipt");
+                List<GenericValue> shipmentReceipts = orderItem.getRelated("ShipmentReceipt", null, null, false);
                 BigDecimal receivedQuantity = BigDecimal.ZERO;
                 for(GenericValue shipmentReceipt : shipmentReceipts) {
                     if (! UtilValidate.isEmpty(shipmentReceipt.get("quantityAccepted"))) {
@@ -5267,7 +5265,7 @@ public class OrderServices {
             BigDecimal itemAdjustments = ZERO; // Item-level tax- and shipping-adjustments
 
             // Aggregate the order items subtotal
-            List<GenericValue> orderItems = orderHeader.getRelated("OrderItem", UtilMisc.toList("orderItemSeqId"));
+            List<GenericValue> orderItems = orderHeader.getRelated("OrderItem", null, UtilMisc.toList("orderItemSeqId"), false);
             for(GenericValue orderItem : orderItems) {
                 // Look at the orderItemBillings to discover the amount and quantity ever invoiced for this order item
                 List<GenericValue> orderItemBillings = delegator.findByAnd("OrderItemBilling", UtilMisc.toMap("orderId", orderId, "orderItemSeqId", orderItem.get("orderItemSeqId")), null, false);
@@ -5625,6 +5623,7 @@ public class OrderServices {
             Debug.logError(e, module);
             return ServiceUtil.returnError(e.getMessage());
         }
+
         for (String orderId: orderIds) {
             Map<String, Object> svcIn = FastMap.newInstance();
             svcIn.put("userLogin", context.get("userLogin"));

Modified: ofbiz/branches/20120329_portletWidget/applications/order/src/org/ofbiz/order/requirement/RequirementServices.java
URL: http://svn.apache.org/viewvc/ofbiz/branches/20120329_portletWidget/applications/order/src/org/ofbiz/order/requirement/RequirementServices.java?rev=1351866&r1=1351865&r2=1351866&view=diff
==============================================================================
--- ofbiz/branches/20120329_portletWidget/applications/order/src/org/ofbiz/order/requirement/RequirementServices.java (original)
+++ ofbiz/branches/20120329_portletWidget/applications/order/src/org/ofbiz/order/requirement/RequirementServices.java Tue Jun 19 21:36:11 2012
@@ -209,15 +209,15 @@ public class RequirementServices {
         String orderId = (String) context.get("orderId");
         try {
             GenericValue order = delegator.findOne("OrderHeader", UtilMisc.toMap("orderId", orderId), false);
-            GenericValue productStore = order.getRelatedOneCache("ProductStore");
+            GenericValue productStore = order.getRelatedOne("ProductStore", true);
             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");
+            List<GenericValue> orderItems = order.getRelated("OrderItem", null, null, false);
             for(GenericValue item : orderItems) {
-                GenericValue product = item.getRelatedOne("Product");
+                GenericValue product = item.getRelatedOne("Product", false);
                 if (product == null) continue;
                 if ((!"PRODRQM_AUTO".equals(product.get("requirementMethodEnumId")) &&
                         !"PRODRQM_AUTO".equals(productStore.get("requirementMethodEnumId"))) ||
@@ -268,15 +268,15 @@ public class RequirementServices {
         String orderId = (String) context.get("orderId");
         try {
             GenericValue order = delegator.findOne("OrderHeader", UtilMisc.toMap("orderId", orderId), false);
-            GenericValue productStore = order.getRelatedOneCache("ProductStore");
+            GenericValue productStore = order.getRelatedOne("ProductStore", true);
             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");
+            List<GenericValue> orderItems = order.getRelated("OrderItem", null, null, false);
             for(GenericValue item : orderItems) {
-                GenericValue product = item.getRelatedOne("Product");
+                GenericValue product = item.getRelatedOne("Product", false);
                 if (product == null) continue;
 
                 if (!("PRODRQM_ATP".equals(product.get("requirementMethodEnumId")) ||

Modified: ofbiz/branches/20120329_portletWidget/applications/order/src/org/ofbiz/order/shoppingcart/CheckOutEvents.java
URL: http://svn.apache.org/viewvc/ofbiz/branches/20120329_portletWidget/applications/order/src/org/ofbiz/order/shoppingcart/CheckOutEvents.java?rev=1351866&r1=1351865&r2=1351866&view=diff
==============================================================================
--- ofbiz/branches/20120329_portletWidget/applications/order/src/org/ofbiz/order/shoppingcart/CheckOutEvents.java (original)
+++ ofbiz/branches/20120329_portletWidget/applications/order/src/org/ofbiz/order/shoppingcart/CheckOutEvents.java Tue Jun 19 21:36:11 2012
@@ -655,7 +655,7 @@ public class CheckOutEvents {
                 payPalProdStorePaySettings = delegator.findByAnd("ProductStorePaymentSetting", UtilMisc.toMap("productStoreId", productStore.getString("productStoreId"), "paymentMethodTypeId", "EXT_PAYPAL"), null, false);
                 GenericValue payPalProdStorePaySetting = EntityUtil.getFirst(payPalProdStorePaySettings);
                 if (payPalProdStorePaySetting != null) {
-                    GenericValue gatewayConfig = payPalProdStorePaySetting.getRelatedOne("PaymentGatewayConfig");
+                    GenericValue gatewayConfig = payPalProdStorePaySetting.getRelatedOne("PaymentGatewayConfig", false);
                     if (gatewayConfig != null && "PAYFLOWPRO".equals(gatewayConfig.getString("paymentGatewayConfigTypeId"))) {
                         return "paypal";
                     }

Modified: ofbiz/branches/20120329_portletWidget/applications/order/src/org/ofbiz/order/shoppingcart/CheckOutHelper.java
URL: http://svn.apache.org/viewvc/ofbiz/branches/20120329_portletWidget/applications/order/src/org/ofbiz/order/shoppingcart/CheckOutHelper.java?rev=1351866&r1=1351865&r2=1351866&view=diff
==============================================================================
--- ofbiz/branches/20120329_portletWidget/applications/order/src/org/ofbiz/order/shoppingcart/CheckOutHelper.java (original)
+++ ofbiz/branches/20120329_portletWidget/applications/order/src/org/ofbiz/order/shoppingcart/CheckOutHelper.java Tue Jun 19 21:36:11 2012
@@ -1207,9 +1207,9 @@ public class CheckOutHelper {
                 GenericValue creditCard = null;
                 GenericValue billingAddress = null;
                 try {
-                    creditCard = paymentMethod.getRelatedOne("CreditCard");
+                    creditCard = paymentMethod.getRelatedOne("CreditCard", false);
                     if (creditCard != null)
-                        billingAddress = creditCard.getRelatedOne("PostalAddress");
+                        billingAddress = creditCard.getRelatedOne("PostalAddress", false);
                 } catch (GenericEntityException e) {
                     Debug.logError(e, "Problems getting credit card from payment method", module);
                     errMsg = UtilProperties.getMessage(resource_error,"checkhelper.problems_reading_database", (cart != null ? cart.getLocale() : Locale.getDefault()));
@@ -1304,7 +1304,7 @@ public class CheckOutHelper {
         if (orderHeader != null) {
             List<GenericValue> paymentPrefs = null;
             try {
-                paymentPrefs = orderHeader.getRelated("OrderPaymentPreference");
+                paymentPrefs = orderHeader.getRelated("OrderPaymentPreference", null, null, false);
             } catch (GenericEntityException e) {
                 Debug.logError(e, "Problems getting order payments", module);
                 errMsg = UtilProperties.getMessage(resource_error,"checkhelper.problems_getting_payment_preference", (cart != null ? cart.getLocale() : Locale.getDefault()));

Modified: ofbiz/branches/20120329_portletWidget/applications/order/src/org/ofbiz/order/shoppingcart/ShoppingCart.java
URL: http://svn.apache.org/viewvc/ofbiz/branches/20120329_portletWidget/applications/order/src/org/ofbiz/order/shoppingcart/ShoppingCart.java?rev=1351866&r1=1351865&r2=1351866&view=diff
==============================================================================
--- ofbiz/branches/20120329_portletWidget/applications/order/src/org/ofbiz/order/shoppingcart/ShoppingCart.java (original)
+++ ofbiz/branches/20120329_portletWidget/applications/order/src/org/ofbiz/order/shoppingcart/ShoppingCart.java Tue Jun 19 21:36:11 2012
@@ -838,7 +838,7 @@ public class ShoppingCart implements Ite
         for(ShoppingCartItem cartItem : this.cartLines) {
             GenericValue product = cartItem.getProduct();
             try {
-                GenericValue productType = product.getRelatedOneCache("ProductType");
+                GenericValue productType = product.getRelatedOne("ProductType", true);
                 if (productType == null || !"N".equals(productType.getString("isPhysical"))) {
                     return false;
                 }
@@ -860,7 +860,7 @@ public class ShoppingCart implements Ite
         for (ShoppingCartItem cartItem: shipInfo.getShipItems()) {
             GenericValue product = cartItem.getProduct();
             try {
-                GenericValue productType = product.getRelatedOneCache("ProductType");
+                GenericValue productType = product.getRelatedOne("ProductType", true);
                 if (productType == null || !"N".equals(productType.getString("isPhysical"))) {
                     return false;
                 }
@@ -965,7 +965,7 @@ public class ShoppingCart implements Ite
         String itemGroupNumber = itemGroupValue.getString("orderItemGroupSeqId");
         ShoppingCartItemGroup itemGroup = this.getItemGroupByNumber(itemGroupNumber);
         if (itemGroup == null) {
-            ShoppingCartItemGroup parentGroup = addItemGroup(itemGroupValue.getRelatedOneCache("ParentOrderItemGroup"));
+            ShoppingCartItemGroup parentGroup = addItemGroup(itemGroupValue.getRelatedOne("ParentOrderItemGroup", true));
             itemGroup = new ShoppingCartItemGroup(itemGroupNumber, itemGroupValue.getString("groupName"), parentGroup);
             int parsedGroupNumber = Integer.parseInt(itemGroupNumber);
             if (parsedGroupNumber > this.nextGroupNumber) {
@@ -1823,7 +1823,7 @@ public class ShoppingCart implements Ite
             for(GenericValue pm : paymentMethods) {
                 if ("CREDIT_CARD".equals(pm.getString("paymentMethodTypeId"))) {
                     try {
-                        GenericValue cc = pm.getRelatedOne("CreditCard");
+                        GenericValue cc = pm.getRelatedOne("CreditCard", false);
                         creditCards.add(cc);
                     } catch (GenericEntityException e) {
                         Debug.logError(e, "Unable to get credit card record from payment method : " + pm, module);
@@ -1842,7 +1842,7 @@ public class ShoppingCart implements Ite
             for(GenericValue pm : paymentMethods) {
                 if ("GIFT_CARD".equals(pm.getString("paymentMethodTypeId"))) {
                     try {
-                        GenericValue gc = pm.getRelatedOne("GiftCard");
+                        GenericValue gc = pm.getRelatedOne("GiftCard", false);
                         giftCards.add(gc);
                     } catch (GenericEntityException e) {
                         Debug.logError(e, "Unable to get gift card record from payment method : " + pm, module);
@@ -4678,7 +4678,7 @@ public class ShoppingCart implements Ite
                         pmObj = delegator.findOne("PayPalPaymentMethod", lookupFields, false);
                     }
                     if (pmObj != null) {
-                        postalAddress = pmObj.getRelatedOne("PostalAddress");
+                        postalAddress = pmObj.getRelatedOne("PostalAddress", false);
                     } else {
                         Debug.logInfo("No PaymentMethod Object Found - " + paymentMethodId, module);
                     }

Modified: ofbiz/branches/20120329_portletWidget/applications/order/src/org/ofbiz/order/shoppingcart/ShoppingCartHelper.java
URL: http://svn.apache.org/viewvc/ofbiz/branches/20120329_portletWidget/applications/order/src/org/ofbiz/order/shoppingcart/ShoppingCartHelper.java?rev=1351866&r1=1351865&r2=1351866&view=diff
==============================================================================
--- ofbiz/branches/20120329_portletWidget/applications/order/src/org/ofbiz/order/shoppingcart/ShoppingCartHelper.java (original)
+++ ofbiz/branches/20120329_portletWidget/applications/order/src/org/ofbiz/order/shoppingcart/ShoppingCartHelper.java Tue Jun 19 21:36:11 2012
@@ -986,7 +986,7 @@ public class ShoppingCartHelper {
             cart.setAgreementId(agreementId);
             try {
                 // set the currency based on the pricing agreement
-                List<GenericValue> agreementItems = agreement.getRelated("AgreementItem", UtilMisc.toMap("agreementItemTypeId", "AGREEMENT_PRICING_PR"), null);
+                List<GenericValue> agreementItems = agreement.getRelated("AgreementItem", UtilMisc.toMap("agreementItemTypeId", "AGREEMENT_PRICING_PR"), null, false);
                 if (agreementItems.size() > 0) {
                     GenericValue agreementItem = agreementItems.get(0);
                     String currencyUomId = (String) agreementItem.get("currencyUomId");
@@ -1009,7 +1009,7 @@ public class ShoppingCartHelper {
                  // clear the existing order terms
                  cart.removeOrderTerms();
                  // set order terms based on agreement terms
-                 List<GenericValue> agreementTerms = EntityUtil.filterByDate(agreement.getRelated("AgreementTerm"));
+                 List<GenericValue> agreementTerms = EntityUtil.filterByDate(agreement.getRelated("AgreementTerm", null, null, false));
                  if (agreementTerms.size() > 0) {
                       for (int i = 0; agreementTerms.size() > i;i++) {
                            GenericValue agreementTerm = agreementTerms.get(i);

Modified: ofbiz/branches/20120329_portletWidget/applications/order/src/org/ofbiz/order/shoppingcart/ShoppingCartItem.java
URL: http://svn.apache.org/viewvc/ofbiz/branches/20120329_portletWidget/applications/order/src/org/ofbiz/order/shoppingcart/ShoppingCartItem.java?rev=1351866&r1=1351865&r2=1351866&view=diff
==============================================================================
--- ofbiz/branches/20120329_portletWidget/applications/order/src/org/ofbiz/order/shoppingcart/ShoppingCartItem.java (original)
+++ ofbiz/branches/20120329_portletWidget/applications/order/src/org/ofbiz/order/shoppingcart/ShoppingCartItem.java Tue Jun 19 21:36:11 2012
@@ -910,7 +910,7 @@ public class ShoppingCartItem implements
         // find the fixed asset itself
         GenericValue fixedAsset = null;
         try {
-            fixedAsset = fixedAssetProduct.getRelatedOne("FixedAsset");
+            fixedAsset = fixedAssetProduct.getRelatedOne("FixedAsset", false);
         } catch (GenericEntityException e) {
             Map<String, Object> messageMap = UtilMisc.<String, Object>toMap("fixedAssetId", fixedAssetProduct.getString("fixedAssetId"));
             String msg = UtilProperties.getMessage(resource_error, "item.fixed_Asset_not_found", messageMap , cart.getLocale());
@@ -927,7 +927,7 @@ public class ShoppingCartItem implements
         // DEJ20050725 this isn't being used anywhere, commenting out for now and not assigning from the getRelatedOne: GenericValue techDataCalendar = null;
         GenericValue techDataCalendar = null;
         try {
-            techDataCalendar = fixedAsset.getRelatedOne("TechDataCalendar");
+            techDataCalendar = fixedAsset.getRelatedOne("TechDataCalendar", false);
         } catch (GenericEntityException e) {
             Debug.logWarning(e, module);
         }
@@ -1848,7 +1848,7 @@ public class ShoppingCartItem implements
         if (product != null) {
             List<GenericValue> featureAppls = null;
             try {
-                featureAppls = product.getRelated("ProductFeatureAppl");
+                featureAppls = product.getRelated("ProductFeatureAppl", null, null, false);
                 List<EntityExpr> filterExprs = UtilMisc.toList(EntityCondition.makeCondition("productFeatureApplTypeId", EntityOperator.EQUALS, "STANDARD_FEATURE"));
                 filterExprs.add(EntityCondition.makeCondition("productFeatureApplTypeId", EntityOperator.EQUALS, "REQUIRED_FEATURE"));
                 featureAppls = EntityUtil.filterByOr(featureAppls, filterExprs);
@@ -1874,7 +1874,7 @@ public class ShoppingCartItem implements
         GenericValue product = this.getProduct();
         if (product != null) {
             try {
-                List<GenericValue> featureAppls = product.getRelated("ProductFeatureAndAppl");
+                List<GenericValue> featureAppls = product.getRelated("ProductFeatureAndAppl", null, null, false);
                 features=EntityUtil.filterByAnd(featureAppls,UtilMisc.toMap("productFeatureApplTypeId","STANDARD_FEATURE"));
             } catch (GenericEntityException e) {
                 Debug.logError(e, "Unable to get features from product : " + product.get("productId"), module);
@@ -2169,7 +2169,7 @@ public class ShoppingCartItem implements
         if (product != null) {
             List<GenericValue> featureAppls = null;
             try {
-                featureAppls = product.getRelated("ProductFeatureAppl");
+                featureAppls = product.getRelated("ProductFeatureAppl", null, null, false);
                 List<EntityExpr> filterExprs = UtilMisc.toList(EntityCondition.makeCondition("productFeatureApplTypeId", EntityOperator.EQUALS, "STANDARD_FEATURE"));
                 filterExprs.add(EntityCondition.makeCondition("productFeatureApplTypeId", EntityOperator.EQUALS, "REQUIRED_FEATURE"));
                 featureAppls = EntityUtil.filterByOr(featureAppls, filterExprs);

Modified: ofbiz/branches/20120329_portletWidget/applications/order/src/org/ofbiz/order/shoppingcart/ShoppingCartServices.java
URL: http://svn.apache.org/viewvc/ofbiz/branches/20120329_portletWidget/applications/order/src/org/ofbiz/order/shoppingcart/ShoppingCartServices.java?rev=1351866&r1=1351865&r2=1351866&view=diff
==============================================================================
--- ofbiz/branches/20120329_portletWidget/applications/order/src/org/ofbiz/order/shoppingcart/ShoppingCartServices.java (original)
+++ ofbiz/branches/20120329_portletWidget/applications/order/src/org/ofbiz/order/shoppingcart/ShoppingCartServices.java Tue Jun 19 21:36:11 2012
@@ -482,7 +482,7 @@ public class ShoppingCartServices {
                 cartItem.setOrderItemSeqId(item.getString("orderItemSeqId"));
 
                 try {
-                    cartItem.setItemGroup(cart.addItemGroup(item.getRelatedOneCache("OrderItemGroup")));
+                    cartItem.setItemGroup(cart.addItemGroup(item.getRelatedOne("OrderItemGroup", true)));
                 } catch (GenericEntityException e) {
                     Debug.logError(e, module);
                     return ServiceUtil.returnError(e.getMessage());
@@ -693,11 +693,11 @@ public class ShoppingCartServices {
         List<GenericValue>quoteAttributes = null;
         List<GenericValue>quoteTerms = null;
         try {
-            quoteItems = quote.getRelated("QuoteItem", UtilMisc.toList("quoteItemSeqId"));
-            quoteAdjs = quote.getRelated("QuoteAdjustment");
-            quoteRoles = quote.getRelated("QuoteRole");
-            quoteAttributes = quote.getRelated("QuoteAttribute");
-            quoteTerms = quote.getRelated("QuoteTerm");
+            quoteItems = quote.getRelated("QuoteItem", null, UtilMisc.toList("quoteItemSeqId"), false);
+            quoteAdjs = quote.getRelated("QuoteAdjustment", null, null, false);
+            quoteRoles = quote.getRelated("QuoteRole", null, null, false);
+            quoteAttributes = quote.getRelated("QuoteAttribute", null, null, false);
+            quoteTerms = quote.getRelated("QuoteTerm", null, null, false);
         } catch (GenericEntityException e) {
             Debug.logError(e, module);
             return ServiceUtil.returnError(e.getMessage());
@@ -971,7 +971,7 @@ public class ShoppingCartServices {
         // If no currency has been set in the ShoppingList, use the ProductStore default currency
         if (currency == null) {
             try {
-                GenericValue productStore = shoppingList.getRelatedOne("ProductStore");
+                GenericValue productStore = shoppingList.getRelatedOne("ProductStore", false);
                 if (productStore != null) {
                     currency = productStore.getString("defaultCurrencyUomId");
                 }
@@ -1004,7 +1004,7 @@ public class ShoppingCartServices {
 
         List<GenericValue>shoppingListItems = null;
         try {
-            shoppingListItems = shoppingList.getRelated("ShoppingListItem");
+            shoppingListItems = shoppingList.getRelated("ShoppingListItem", null, null, false);
         } catch (GenericEntityException e) {
             Debug.logError(e, module);
             return ServiceUtil.returnError(e.getMessage());

Modified: ofbiz/branches/20120329_portletWidget/applications/order/src/org/ofbiz/order/shoppingcart/product/ProductDisplayWorker.java
URL: http://svn.apache.org/viewvc/ofbiz/branches/20120329_portletWidget/applications/order/src/org/ofbiz/order/shoppingcart/product/ProductDisplayWorker.java?rev=1351866&r1=1351865&r2=1351866&view=diff
==============================================================================
--- ofbiz/branches/20120329_portletWidget/applications/order/src/org/ofbiz/order/shoppingcart/product/ProductDisplayWorker.java (original)
+++ ofbiz/branches/20120329_portletWidget/applications/order/src/org/ofbiz/order/shoppingcart/product/ProductDisplayWorker.java Tue Jun 19 21:36:11 2012
@@ -82,13 +82,13 @@ public class ProductDisplayWorker {
                 productsCategories = EntityUtil.filterByDate(productsCategories, true);
                 if (productsCategories != null) {
                     for(GenericValue productsCategoryMember : productsCategories) {
-                        GenericValue productsCategory = productsCategoryMember.getRelatedOneCache("ProductCategory");
+                        GenericValue productsCategory = productsCategoryMember.getRelatedOne("ProductCategory", true);
                         if ("CROSS_SELL_CATEGORY".equals(productsCategory.getString("productCategoryTypeId"))) {
-                            List<GenericValue> curPcms = productsCategory.getRelatedCache("ProductCategoryMember");
+                            List<GenericValue> curPcms = productsCategory.getRelated("ProductCategoryMember", null, null, true);
                             if (curPcms != null) {
                                 for(GenericValue curPcm : curPcms) {
                                     if (!products.containsKey(curPcm.getString("productId"))) {
-                                        GenericValue product = curPcm.getRelatedOneCache("Product");
+                                        GenericValue product = curPcm.getRelatedOne("Product", true);
                                         products.put(product.getString("productId"), product);
                                     }
                                 }
@@ -100,7 +100,7 @@ public class ProductDisplayWorker {
                 if (UtilValidate.isNotEmpty(complementProducts)) {
                     for(GenericValue productAssoc : complementProducts) {
                         if (!products.containsKey(productAssoc.getString("productIdTo"))) {
-                            GenericValue product = productAssoc.getRelatedOneCache("AssocProduct");
+                            GenericValue product = productAssoc.getRelatedOne("AssocProduct", true);
                             products.put(product.getString("productId"), product);
                         }
                     }
@@ -175,7 +175,7 @@ public class ProductDisplayWorker {
                 while (ordersIter != null && ordersIter.hasNext()) {
                     GenericValue orderRole = ordersIter.next();
                     // for each order role get all order items
-                    List<GenericValue> orderItems = orderRole.getRelated("OrderItem");
+                    List<GenericValue> orderItems = orderRole.getRelated("OrderItem", null, null, false);
                     Iterator<GenericValue> orderItemsIter = UtilMisc.toIterator(orderItems);
 
                     while (orderItemsIter != null && orderItemsIter.hasNext()) {
@@ -183,7 +183,7 @@ public class ProductDisplayWorker {
                         String productId = orderItem.getString("productId");
                         if (UtilValidate.isNotEmpty(productId)) {
                             // for each order item get the associated product
-                            GenericValue product = orderItem.getRelatedOneCache("Product");
+                            GenericValue product = orderItem.getRelatedOne("Product", true);
 
                             products.put(product.getString("productId"), product);
 

Modified: ofbiz/branches/20120329_portletWidget/applications/order/src/org/ofbiz/order/shoppingcart/product/ProductPromoWorker.java
URL: http://svn.apache.org/viewvc/ofbiz/branches/20120329_portletWidget/applications/order/src/org/ofbiz/order/shoppingcart/product/ProductPromoWorker.java?rev=1351866&r1=1351865&r2=1351866&view=diff
==============================================================================
--- ofbiz/branches/20120329_portletWidget/applications/order/src/org/ofbiz/order/shoppingcart/product/ProductPromoWorker.java (original)
+++ ofbiz/branches/20120329_portletWidget/applications/order/src/org/ofbiz/order/shoppingcart/product/ProductPromoWorker.java Tue Jun 19 21:36:11 2012
@@ -112,7 +112,7 @@ public class ProductPromoWorker {
             }
 
             if (productStore != null) {
-                Iterator<GenericValue> productStorePromoAppls = UtilMisc.toIterator(EntityUtil.filterByDate(productStore.getRelatedCache("ProductStorePromoAppl", UtilMisc.toMap("productStoreId", productStoreId), UtilMisc.toList("sequenceNum")), true));
+                Iterator<GenericValue> productStorePromoAppls = UtilMisc.toIterator(EntityUtil.filterByDate(productStore.getRelated("ProductStorePromoAppl", UtilMisc.toMap("productStoreId", productStoreId), UtilMisc.toList("sequenceNum"), true), true));
                 while (productStorePromoAppls != null && productStorePromoAppls.hasNext()) {
                     GenericValue productStorePromoAppl = productStorePromoAppls.next();
                     if (UtilValidate.isNotEmpty(productStorePromoAppl.getString("manualOnly")) && "Y".equals(productStorePromoAppl.getString("manualOnly"))) {
@@ -120,8 +120,8 @@ public class ProductPromoWorker {
                         if (Debug.verboseOn()) Debug.logVerbose("Skipping promotion with id [" + productStorePromoAppl.getString("productPromoId") + "] because it is applied to the store with ID " + productStoreId + " as a manual only promotion.", module);
                         continue;
                     }
-                    GenericValue productPromo = productStorePromoAppl.getRelatedOneCache("ProductPromo");
-                    List<GenericValue> productPromoRules = productPromo.getRelatedCache("ProductPromoRule", null, null);
+                    GenericValue productPromo = productStorePromoAppl.getRelatedOne("ProductPromo", true);
+                    List<GenericValue> productPromoRules = productPromo.getRelated("ProductPromoRule", null, null, true);
 
 
                     if (productPromoRules != null) {
@@ -129,7 +129,7 @@ public class ProductPromoWorker {
 
                         while (condResult && promoRulesItr != null && promoRulesItr.hasNext()) {
                             GenericValue promoRule = promoRulesItr.next();
-                            Iterator<GenericValue> productPromoConds = UtilMisc.toIterator(promoRule.getRelatedCache("ProductPromoCond", null, UtilMisc.toList("productPromoCondSeqId")));
+                            Iterator<GenericValue> productPromoConds = UtilMisc.toIterator(promoRule.getRelated("ProductPromoCond", null, UtilMisc.toList("productPromoCondSeqId"), true));
 
                             while (condResult && productPromoConds != null && productPromoConds.hasNext()) {
                                 GenericValue productPromoCond = productPromoConds.next();
@@ -173,7 +173,7 @@ public class ProductPromoWorker {
             return promoCodes;
         }
         try {
-            Iterator<GenericValue> productStorePromoAppls = UtilMisc.toIterator(EntityUtil.filterByDate(productStore.getRelatedCache("ProductStorePromoAppl", UtilMisc.toMap("productStoreId", productStoreId), UtilMisc.toList("sequenceNum")), true));
+            Iterator<GenericValue> productStorePromoAppls = UtilMisc.toIterator(EntityUtil.filterByDate(productStore.getRelated("ProductStorePromoAppl", UtilMisc.toMap("productStoreId", productStoreId), UtilMisc.toList("sequenceNum"), true), true));
             while (productStorePromoAppls != null && productStorePromoAppls.hasNext()) {
                 GenericValue productStorePromoAppl = productStorePromoAppls.next();
                 if (UtilValidate.isNotEmpty(productStorePromoAppl.getString("manualOnly")) && "Y".equals(productStorePromoAppl.getString("manualOnly"))) {
@@ -181,8 +181,8 @@ public class ProductPromoWorker {
                     if (Debug.verboseOn()) Debug.logVerbose("Skipping promotion with id [" + productStorePromoAppl.getString("productPromoId") + "] because it is applied to the store with ID " + productStoreId + " as a manual only promotion.", module);
                         continue;
                 }
-                GenericValue productPromo = productStorePromoAppl.getRelatedOneCache("ProductPromo");
-                Iterator<GenericValue> productPromoCodesIter = UtilMisc.toIterator(productPromo.getRelatedCache("ProductPromoCode", null, null));
+                GenericValue productPromo = productStorePromoAppl.getRelatedOne("ProductPromo", true);
+                Iterator<GenericValue> productPromoCodesIter = UtilMisc.toIterator(productPromo.getRelated("ProductPromoCode", null, null, true));
                 while (productPromoCodesIter != null && productPromoCodesIter.hasNext()) {
                     GenericValue productPromoCode = productPromoCodesIter.next();
                     promoCodes.add(productPromoCode.getString("productPromoCodeId"));
@@ -213,7 +213,7 @@ public class ProductPromoWorker {
 
         try {
             // loop through promotions and get a list of all of the rules...
-            List<GenericValue> productStorePromoApplsList = productStore.getRelatedCache("ProductStorePromoAppl", null, UtilMisc.toList("sequenceNum"));
+            List<GenericValue> productStorePromoApplsList = productStore.getRelated("ProductStorePromoAppl", null, UtilMisc.toList("sequenceNum"), true);
             productStorePromoApplsList = EntityUtil.filterByDate(productStorePromoApplsList, nowTimestamp);
 
             if (UtilValidate.isEmpty(productStorePromoApplsList)) {
@@ -228,7 +228,7 @@ public class ProductPromoWorker {
                     if (Debug.verboseOn()) Debug.logVerbose("Skipping promotion with id [" + prodCatalogPromoAppl.getString("productPromoId") + "] because it is applied to the store with ID " + productStoreId + " as a manual only promotion.", module);
                     continue;
                 }
-                GenericValue productPromo = prodCatalogPromoAppl.getRelatedOneCache("ProductPromo");
+                GenericValue productPromo = prodCatalogPromoAppl.getRelatedOne("ProductPromo", true);
                 productPromoList.add(productPromo);
             }
         } catch (GenericEntityException e) {
@@ -267,7 +267,7 @@ public class ProductPromoWorker {
 
         try {
             // loop through promotions and get a list of all of the rules...
-            List<GenericValue> agreementPromoApplsList = agreementItem.getRelatedCache("AgreementPromoAppl", null, UtilMisc.toList("sequenceNum"));
+            List<GenericValue> agreementPromoApplsList = agreementItem.getRelated("AgreementPromoAppl", null, UtilMisc.toList("sequenceNum"), true);
             agreementPromoApplsList = EntityUtil.filterByDate(agreementPromoApplsList, nowTimestamp);
 
             if (UtilValidate.isEmpty(agreementPromoApplsList)) {
@@ -277,7 +277,7 @@ public class ProductPromoWorker {
             Iterator<GenericValue> agreementPromoAppls = UtilMisc.toIterator(agreementPromoApplsList);
             while (agreementPromoAppls != null && agreementPromoAppls.hasNext()) {
                 GenericValue agreementPromoAppl = agreementPromoAppls.next();
-                GenericValue productPromo = agreementPromoAppl.getRelatedOneCache("ProductPromo");
+                GenericValue productPromo = agreementPromoAppl.getRelatedOne("ProductPromo", true);
                 productPromoList.add(productPromo);
             }
         } catch (GenericEntityException e) {
@@ -404,7 +404,7 @@ public class ProductPromoWorker {
                 for(GenericValue productPromo : productPromoList) {
                     String productPromoId = productPromo.getString("productPromoId");
 
-                    List<GenericValue> productPromoRules = productPromo.getRelatedCache("ProductPromoRule", null, null);
+                    List<GenericValue> productPromoRules = productPromo.getRelated("ProductPromoRule", null, null, true);
                     if (UtilValidate.isNotEmpty(productPromoRules)) {
                         // always have a useLimit to avoid unlimited looping, default to 1 if no other is specified
                         Long candidateUseLimit = getProductPromoUseLimit(productPromo, partyId, delegator);
@@ -647,14 +647,14 @@ public class ProductPromoWorker {
             return "";
         }
         StringBuilder promoDescBuf = new StringBuilder();
-        List<GenericValue> productPromoRules = productPromo.getRelatedCache("ProductPromoRule", null, null);
+        List<GenericValue> productPromoRules = productPromo.getRelated("ProductPromoRule", null, null, true);
         Iterator<GenericValue> promoRulesIter = productPromoRules.iterator();
         while (promoRulesIter != null && promoRulesIter.hasNext()) {
             GenericValue productPromoRule = promoRulesIter.next();
 
             List<GenericValue> productPromoConds = delegator.findByAnd("ProductPromoCond", UtilMisc.toMap("productPromoId", productPromo.get("productPromoId")), UtilMisc.toList("productPromoCondSeqId"), true);
             productPromoConds = EntityUtil.filterByAnd(productPromoConds, UtilMisc.toMap("productPromoRuleId", productPromoRule.get("productPromoRuleId")));
-            // using the other method to consolodate cache entries because the same cache is used elsewhere: List productPromoConds = productPromoRule.getRelatedCache("ProductPromoCond", null, UtilMisc.toList("productPromoCondSeqId"));
+            // using the other method to consolodate cache entries because the same cache is used elsewhere: List productPromoConds = productPromoRule.getRelated("ProductPromoCond", null, UtilMisc.toList("productPromoCondSeqId"), true);
             Iterator<GenericValue> productPromoCondIter = UtilMisc.toIterator(productPromoConds);
             while (productPromoCondIter != null && productPromoCondIter.hasNext()) {
                 GenericValue productPromoCond = productPromoCondIter.next();
@@ -677,7 +677,7 @@ public class ProductPromoWorker {
                 }
             }
 
-            List<GenericValue> productPromoActions = productPromoRule.getRelatedCache("ProductPromoAction", null, UtilMisc.toList("productPromoActionSeqId"));
+            List<GenericValue> productPromoActions = productPromoRule.getRelated("ProductPromoAction", null, UtilMisc.toList("productPromoActionSeqId"), true);
             Iterator<GenericValue> productPromoActionIter = UtilMisc.toIterator(productPromoActions);
             while (productPromoActionIter != null && productPromoActionIter.hasNext()) {
                 GenericValue productPromoAction = productPromoActionIter.next();
@@ -755,7 +755,7 @@ public class ProductPromoWorker {
                 // loop through conditions for rule, if any false, set allConditionsTrue to false
                 List<GenericValue> productPromoConds = delegator.findByAnd("ProductPromoCond", UtilMisc.toMap("productPromoId", productPromo.get("productPromoId")), UtilMisc.toList("productPromoCondSeqId"), true);
                 productPromoConds = EntityUtil.filterByAnd(productPromoConds, UtilMisc.toMap("productPromoRuleId", productPromoRule.get("productPromoRuleId")));
-                // using the other method to consolodate cache entries because the same cache is used elsewhere: List productPromoConds = productPromoRule.getRelatedCache("ProductPromoCond", null, UtilMisc.toList("productPromoCondSeqId"));
+                // using the other method to consolodate cache entries because the same cache is used elsewhere: List productPromoConds = productPromoRule.getRelated("ProductPromoCond", null, UtilMisc.toList("productPromoCondSeqId"), true);
                 if (Debug.verboseOn()) Debug.logVerbose("Checking " + productPromoConds.size() + " conditions for rule " + productPromoRule, module);
 
                 Iterator<GenericValue> productPromoCondIter = UtilMisc.toIterator(productPromoConds);
@@ -774,7 +774,7 @@ public class ProductPromoWorker {
                 if (performActions) {
                     // perform all actions, either apply or unapply
 
-                    List<GenericValue> productPromoActions = productPromoRule.getRelatedCache("ProductPromoAction", null, UtilMisc.toList("productPromoActionSeqId"));
+                    List<GenericValue> productPromoActions = productPromoRule.getRelated("ProductPromoAction", null, UtilMisc.toList("productPromoActionSeqId"), true);
                     Iterator<GenericValue> productPromoActionIter = UtilMisc.toIterator(productPromoActions);
                     while (productPromoActionIter != null && productPromoActionIter.hasNext()) {
                         GenericValue productPromoAction = productPromoActionIter.next();
@@ -1255,7 +1255,7 @@ public class ProductPromoWorker {
     }
 
     protected static boolean checkConditionsForItem(GenericValue productPromoActionOrCond, ShoppingCart cart, ShoppingCartItem cartItem, Delegator delegator, LocalDispatcher dispatcher, Timestamp nowTimestamp) throws GenericEntityException {
-        GenericValue productPromoRule = productPromoActionOrCond.getRelatedOneCache("ProductPromoRule");
+        GenericValue productPromoRule = productPromoActionOrCond.getRelatedOne("ProductPromoRule", true);
 
         List<GenericValue> productPromoConds = delegator.findByAnd("ProductPromoCond", UtilMisc.toMap("productPromoId", productPromoRule.get("productPromoId")), UtilMisc.toList("productPromoCondSeqId"), true);
         productPromoConds = EntityUtil.filterByAnd(productPromoConds, UtilMisc.toMap("productPromoRuleId", productPromoRule.get("productPromoRuleId")));
@@ -1423,8 +1423,7 @@ public class ProductPromoWorker {
                         throw new CartItemModifyException(errMsg);
                     }
                     if ("Y".equals(product.getString("isVirtual"))) {
-                        List<GenericValue> productAssocs = EntityUtil.filterByDate(product.getRelatedCache("MainProductAssoc",
-                                UtilMisc.toMap("productAssocTypeId", "PRODUCT_VARIANT"), UtilMisc.toList("sequenceNum")));
+                        List<GenericValue> productAssocs = EntityUtil.filterByDate(product.getRelated("MainProductAssoc", UtilMisc.toMap("productAssocTypeId", "PRODUCT_VARIANT"), UtilMisc.toList("sequenceNum"), true));
                         for(GenericValue productAssoc : productAssocs) {
                             optionProductIds.add(productAssoc.getString("productIdTo"));
                         }

Modified: ofbiz/branches/20120329_portletWidget/applications/order/src/org/ofbiz/order/shoppinglist/ShoppingListEvents.java
URL: http://svn.apache.org/viewvc/ofbiz/branches/20120329_portletWidget/applications/order/src/org/ofbiz/order/shoppinglist/ShoppingListEvents.java?rev=1351866&r1=1351865&r2=1351866&view=diff
==============================================================================
--- ofbiz/branches/20120329_portletWidget/applications/order/src/org/ofbiz/order/shoppinglist/ShoppingListEvents.java (original)
+++ ofbiz/branches/20120329_portletWidget/applications/order/src/org/ofbiz/order/shoppinglist/ShoppingListEvents.java Tue Jun 19 21:36:11 2012
@@ -219,16 +219,16 @@ public class ShoppingListEvents {
                 throw new IllegalArgumentException(errMsg);
             }
 
-            shoppingListItems = shoppingList.getRelated("ShoppingListItem");
+            shoppingListItems = shoppingList.getRelated("ShoppingListItem", null, null, false);
             if (shoppingListItems == null) {
                 shoppingListItems = FastList.newInstance();
             }
 
             // include all items of child lists if flagged to do so
             if (includeChild) {
-                List<GenericValue> childShoppingLists = shoppingList.getRelated("ChildShoppingList");
+                List<GenericValue> childShoppingLists = shoppingList.getRelated("ChildShoppingList", null, null, false);
                 for(GenericValue v : childShoppingLists) {
-                    List<GenericValue> items = v.getRelated("ShoppingListItem");
+                    List<GenericValue> items = v.getRelated("ShoppingListItem", null, null, false);
                     shoppingListItems.addAll(items);
                 }
             }
@@ -406,7 +406,7 @@ public class ShoppingListEvents {
             GenericValue shoppingList = delegator.findOne("ShoppingList", UtilMisc.toMap("shoppingListId", autoSaveListId), false);
             Integer currentListSize = 0;
             if (UtilValidate.isNotEmpty(shoppingList)) {
-                List<GenericValue> shoppingListItems = shoppingList.getRelated("ShoppingListItem");
+                List<GenericValue> shoppingListItems = shoppingList.getRelated("ShoppingListItem", null, null, false);
                 if (UtilValidate.isNotEmpty(shoppingListItems)) {
                     currentListSize = shoppingListItems.size();
                 }
@@ -588,7 +588,7 @@ public class ShoppingListEvents {
         List<String> responseIds = FastList.newInstance();
         List<GenericValue> surveyResp = null;
         try {
-            surveyResp = item.getRelated("ShoppingListItemSurvey");
+            surveyResp = item.getRelated("ShoppingListItemSurvey", null, null, false);
         } catch (GenericEntityException e) {
             Debug.logError(e, module);
         }

Modified: ofbiz/branches/20120329_portletWidget/applications/order/src/org/ofbiz/order/shoppinglist/ShoppingListServices.java
URL: http://svn.apache.org/viewvc/ofbiz/branches/20120329_portletWidget/applications/order/src/org/ofbiz/order/shoppinglist/ShoppingListServices.java?rev=1351866&r1=1351865&r2=1351866&view=diff
==============================================================================
--- ofbiz/branches/20120329_portletWidget/applications/order/src/org/ofbiz/order/shoppinglist/ShoppingListServices.java (original)
+++ ofbiz/branches/20120329_portletWidget/applications/order/src/org/ofbiz/order/shoppinglist/ShoppingListServices.java Tue Jun 19 21:36:11 2012
@@ -143,7 +143,7 @@ public class ShoppingListServices {
                 while (((shoppingList = eli.next()) != null)) {
                     Timestamp lastOrder = shoppingList.getTimestamp("lastOrderedDate");
                     GenericValue recurrenceInfo = null;
-                    recurrenceInfo = shoppingList.getRelatedOne("RecurrenceInfo");
+                    recurrenceInfo = shoppingList.getRelatedOne("RecurrenceInfo", false);
 
                     Timestamp startDateTime = recurrenceInfo.getTimestamp("startDateTime");
                     RecurrenceInfo recurrence = null;
@@ -446,7 +446,7 @@ public class ShoppingListServices {
 
             List<GenericValue> items = null;
             try {
-                items = shoppingList.getRelated("ShoppingListItem", UtilMisc.toList("shoppingListItemSeqId"));
+                items = shoppingList.getRelated("ShoppingListItem", null, UtilMisc.toList("shoppingListItemSeqId"), false);
             } catch (GenericEntityException e) {
                 Debug.logError(e, module);
             }
@@ -617,7 +617,7 @@ public class ShoppingListServices {
                 if (expireDate.equals(nowDate) || nowDate.after(expireDate)) {
                     List<GenericValue> shoppingListItems = null;
                     try {
-                        shoppingListItems = sl.getRelated("ShoppingListItem");
+                        shoppingListItems = sl.getRelated("ShoppingListItem", null, null, false);
                     } catch (GenericEntityException e) {
                         Debug.logError(e.getMessage(), module);
                     }

Modified: ofbiz/branches/20120329_portletWidget/applications/order/src/org/ofbiz/order/thirdparty/paypal/ExpressCheckoutEvents.java
URL: http://svn.apache.org/viewvc/ofbiz/branches/20120329_portletWidget/applications/order/src/org/ofbiz/order/thirdparty/paypal/ExpressCheckoutEvents.java?rev=1351866&r1=1351865&r2=1351866&view=diff
==============================================================================
--- ofbiz/branches/20120329_portletWidget/applications/order/src/org/ofbiz/order/thirdparty/paypal/ExpressCheckoutEvents.java (original)
+++ ofbiz/branches/20120329_portletWidget/applications/order/src/org/ofbiz/order/thirdparty/paypal/ExpressCheckoutEvents.java Tue Jun 19 21:36:11 2012
@@ -210,13 +210,13 @@ public class ExpressCheckoutEvents {
         GenericValue payPalPaymentSetting = ProductStoreWorker.getProductStorePaymentSetting(delegator, productStoreId, "EXT_PAYPAL", null, true);
         if (payPalPaymentSetting != null && payPalPaymentSetting.getString("paymentGatewayConfigId") != null) {
             try {
-                GenericValue paymentGatewayConfig = payPalPaymentSetting.getRelatedOne("PaymentGatewayConfig");
+                GenericValue paymentGatewayConfig = payPalPaymentSetting.getRelatedOne("PaymentGatewayConfig", false);
                 String paymentGatewayConfigTypeId = paymentGatewayConfig.getString("paymentGatewayConfigTypeId");
                 if (paymentGatewayConfig != null) {
                     if ("PAYFLOWPRO".equals(paymentGatewayConfigTypeId)) {
                         return CheckoutType.PAYFLOW;
                     } else if ("PAYPAL".equals(paymentGatewayConfigTypeId)) {
-                        GenericValue payPalConfig = paymentGatewayConfig.getRelatedOne("PaymentGatewayPayPal");
+                        GenericValue payPalConfig = paymentGatewayConfig.getRelatedOne("PaymentGatewayPayPal", false);
                         // TODO: Probably better off with an indicator field to indicate Express Checkout use
                         if (UtilValidate.isNotEmpty(payPalConfig.get("apiUserName"))) {
                             return CheckoutType.STANDARD;

Modified: ofbiz/branches/20120329_portletWidget/applications/order/webapp/ordermgr/WEB-INF/actions/entry/AdditionalPartyListing.groovy
URL: http://svn.apache.org/viewvc/ofbiz/branches/20120329_portletWidget/applications/order/webapp/ordermgr/WEB-INF/actions/entry/AdditionalPartyListing.groovy?rev=1351866&r1=1351865&r2=1351866&view=diff
==============================================================================
--- ofbiz/branches/20120329_portletWidget/applications/order/webapp/ordermgr/WEB-INF/actions/entry/AdditionalPartyListing.groovy (original)
+++ ofbiz/branches/20120329_portletWidget/applications/order/webapp/ordermgr/WEB-INF/actions/entry/AdditionalPartyListing.groovy Tue Jun 19 21:36:11 2012
@@ -36,12 +36,12 @@ additionalPartyRole.each { roleTypeId, p
         partyMap.partyId = partyId;
         party = delegator.findOne("Party", [partyId : partyId], true);
         if (party.partyTypeId.equals("PERSON")) {
-            party = party.getRelatedOneCache("Person");
+            party = party.getRelatedOne("Person", true);
             partyMap.type = "person";
             partyMap.firstName = party.firstName;
             partyMap.lastName = party.lastName;
         } else {
-            party = party.getRelatedOneCache("PartyGroup");
+            party = party.getRelatedOne("PartyGroup", true);
             partyMap.type = "group";
             partyMap.groupName = party.groupName;
         }

Modified: ofbiz/branches/20120329_portletWidget/applications/order/webapp/ordermgr/WEB-INF/actions/entry/BillSettings.groovy
URL: http://svn.apache.org/viewvc/ofbiz/branches/20120329_portletWidget/applications/order/webapp/ordermgr/WEB-INF/actions/entry/BillSettings.groovy?rev=1351866&r1=1351865&r2=1351866&view=diff
==============================================================================
--- ofbiz/branches/20120329_portletWidget/applications/order/webapp/ordermgr/WEB-INF/actions/entry/BillSettings.groovy (original)
+++ ofbiz/branches/20120329_portletWidget/applications/order/webapp/ordermgr/WEB-INF/actions/entry/BillSettings.groovy Tue Jun 19 21:36:11 2012
@@ -42,11 +42,11 @@ if (newPaymentMethodId) {
 
 if (orderPartyId && !orderPartyId.equals("_NA_")) {
     orderParty = delegator.findOne("Party", [partyId : orderPartyId], false);
-    orderPerson = orderParty.getRelatedOne("Person");
+    orderPerson = orderParty.getRelatedOne("Person", false);
     context.orderParty = orderParty;
     context.orderPerson = orderPerson;
     if (orderParty) {
-        context.paymentMethodList = EntityUtil.filterByDate(orderParty.getRelated("PaymentMethod"), true);
+        context.paymentMethodList = EntityUtil.filterByDate(orderParty.getRelated("PaymentMethod", null, null, false), true);
 
         billingAccountList = BillingAccountWorker.makePartyBillingAccountList(userLogin, currencyUomId, orderPartyId, delegator, dispatcher);
         if (billingAccountList) {
@@ -72,17 +72,17 @@ if (cart) {
             paymentMethod = delegator.findOne("PaymentMethod", [paymentMethodId : checkOutPaymentId], false);
             if ("CREDIT_CARD".equals(paymentMethod?.paymentMethodTypeId)) {
                 paymentMethodType = "CC";
-                account = paymentMethod.getRelatedOne("CreditCard");
+                account = paymentMethod.getRelatedOne("CreditCard", false);
                 context.creditCard = account;
                 context.paymentMethodType = paymentMethodType;
             } else if ("EFT_ACCOUNT".equals(paymentMethod.paymentMethodTypeId)) {
                 paymentMethodType = "EFT";
-                account = paymentMethod.getRelatedOne("EftAccount");
+                account = paymentMethod.getRelatedOne("EftAccount", false);
                 context.eftAccount = account;
                 context.paymentMethodType = paymentMethodType;
             }
             if (account) {
-                address = account.getRelatedOne("PostalAddress");
+                address = account.getRelatedOne("PostalAddress", false);
                 context.postalAddress = address;
             }
         }

Modified: ofbiz/branches/20120329_portletWidget/applications/order/webapp/ordermgr/WEB-INF/actions/entry/CheckoutPayment.groovy
URL: http://svn.apache.org/viewvc/ofbiz/branches/20120329_portletWidget/applications/order/webapp/ordermgr/WEB-INF/actions/entry/CheckoutPayment.groovy?rev=1351866&r1=1351865&r2=1351866&view=diff
==============================================================================
--- ofbiz/branches/20120329_portletWidget/applications/order/webapp/ordermgr/WEB-INF/actions/entry/CheckoutPayment.groovy (original)
+++ ofbiz/branches/20120329_portletWidget/applications/order/webapp/ordermgr/WEB-INF/actions/entry/CheckoutPayment.groovy Tue Jun 19 21:36:11 2012
@@ -49,7 +49,7 @@ context.shoppingCart = cart;
 context.userLogin = userLogin;
 context.productStoreId = productStoreId;
 context.checkOutPaymentId = checkOutPaymentId;
-context.paymentMethodList = EntityUtil.filterByDate(party.getRelated("PaymentMethod", null, ["paymentMethodTypeId"]), true);
+context.paymentMethodList = EntityUtil.filterByDate(party.getRelated("PaymentMethod", null, ["paymentMethodTypeId"], false), true);
 
 billingAccountList = BillingAccountWorker.makePartyBillingAccountList(userLogin, currencyUomId, partyId, delegator, dispatcher);
 if (billingAccountList) {
@@ -59,7 +59,7 @@ if (billingAccountList) {
 
 checkIdealPayment = false;
 productStore = ProductStoreWorker.getProductStore(request);
-productStorePaymentSettingList = productStore.getRelatedCache("ProductStorePaymentSetting");
+productStorePaymentSettingList = productStore.getRelated("ProductStorePaymentSetting", null, null, true);
 productStorePaymentSettingIter = productStorePaymentSettingList.iterator();
 while (productStorePaymentSettingIter.hasNext()) {
     productStorePaymentSetting = productStorePaymentSettingIter.next();

Modified: ofbiz/branches/20120329_portletWidget/applications/order/webapp/ordermgr/WEB-INF/actions/entry/CheckoutReview.groovy
URL: http://svn.apache.org/viewvc/ofbiz/branches/20120329_portletWidget/applications/order/webapp/ordermgr/WEB-INF/actions/entry/CheckoutReview.groovy?rev=1351866&r1=1351865&r2=1351866&view=diff
==============================================================================
--- ofbiz/branches/20120329_portletWidget/applications/order/webapp/ordermgr/WEB-INF/actions/entry/CheckoutReview.groovy (original)
+++ ofbiz/branches/20120329_portletWidget/applications/order/webapp/ordermgr/WEB-INF/actions/entry/CheckoutReview.groovy Tue Jun 19 21:36:11 2012
@@ -62,7 +62,7 @@ context.headerAdjustmentsToShow = OrderR
 
 orderSubTotal = OrderReadHelper.getOrderItemsSubTotal(orderItems, orderAdjustments);
 context.orderSubTotal = orderSubTotal;
-context.placingCustomerPerson = userLogin?.getRelatedOne("Person");
+context.placingCustomerPerson = userLogin?.getRelatedOne("Person", false);
 context.shippingAddress = cart.getShippingAddress();
 
 paymentMethods = cart.getPaymentMethods();
@@ -73,11 +73,11 @@ if (paymentMethods) {
 }
 
 if ("CREDIT_CARD".equals(paymentMethod?.paymentMethodTypeId)) {
-    creditCard = paymentMethod.getRelatedOneCache("CreditCard");
+    creditCard = paymentMethod.getRelatedOne("CreditCard", true);
     context.creditCard = creditCard;
     context.formattedCardNumber = ContactHelper.formatCreditCard(creditCard);
 } else if ("EFT_ACCOUNT".equals(paymentMethod?.paymentMethodTypeId)) {
-    eftAccount = paymentMethod.getRelatedOneCache("EftAccount");
+    eftAccount = paymentMethod.getRelatedOne("EftAccount", true);
     context.eftAccount = eftAccount;
 }
 
@@ -101,8 +101,8 @@ if (productStore) {
 
 billingAddress = null;
 if (paymentMethod) {
-    creditCard = paymentMethod.getRelatedOne("CreditCard");
-    billingAddress = creditCard?.getRelatedOne("PostalAddress");
+    creditCard = paymentMethod.getRelatedOne("CreditCard", false);
+    billingAddress = creditCard?.getRelatedOne("PostalAddress", false);
 }
 if (billingAddress) context.billingAddress = billingAddress;
 

Modified: ofbiz/branches/20120329_portletWidget/applications/order/webapp/ordermgr/WEB-INF/actions/entry/CheckoutShippingAddress.groovy
URL: http://svn.apache.org/viewvc/ofbiz/branches/20120329_portletWidget/applications/order/webapp/ordermgr/WEB-INF/actions/entry/CheckoutShippingAddress.groovy?rev=1351866&r1=1351865&r2=1351866&view=diff
==============================================================================
--- ofbiz/branches/20120329_portletWidget/applications/order/webapp/ordermgr/WEB-INF/actions/entry/CheckoutShippingAddress.groovy (original)
+++ ofbiz/branches/20120329_portletWidget/applications/order/webapp/ordermgr/WEB-INF/actions/entry/CheckoutShippingAddress.groovy Tue Jun 19 21:36:11 2012
@@ -29,7 +29,7 @@ import org.ofbiz.entity.condition.Entity
 import javolution.util.FastList;
 
 cart = session.getAttribute("shoppingCart");
-party = userLogin.getRelatedOne("Party");
+party = userLogin.getRelatedOne("Party", false);
 partyId = party.partyId;
 productStoreId = ProductStoreWorker.getProductStoreId(request);
 

Modified: ofbiz/branches/20120329_portletWidget/applications/order/webapp/ordermgr/WEB-INF/actions/entry/SetAdditionalParty.groovy
URL: http://svn.apache.org/viewvc/ofbiz/branches/20120329_portletWidget/applications/order/webapp/ordermgr/WEB-INF/actions/entry/SetAdditionalParty.groovy?rev=1351866&r1=1351865&r2=1351866&view=diff
==============================================================================
--- ofbiz/branches/20120329_portletWidget/applications/order/webapp/ordermgr/WEB-INF/actions/entry/SetAdditionalParty.groovy (original)
+++ ofbiz/branches/20120329_portletWidget/applications/order/webapp/ordermgr/WEB-INF/actions/entry/SetAdditionalParty.groovy Tue Jun 19 21:36:11 2012
@@ -35,7 +35,7 @@ if (!request.getParameterValues("additio
     roles = delegator.findByAnd("PartyRole", [partyId : additionalPartyId], null, false);
     roleData = [];
     roles.each { role ->
-        roleData.add(role.getRelatedOne("RoleType"));
+        roleData.add(role.getRelatedOne("RoleType", false));
     }
     context.roles = roleData;
 }

Modified: ofbiz/branches/20120329_portletWidget/applications/order/webapp/ordermgr/WEB-INF/actions/entry/ShipSettings.groovy
URL: http://svn.apache.org/viewvc/ofbiz/branches/20120329_portletWidget/applications/order/webapp/ordermgr/WEB-INF/actions/entry/ShipSettings.groovy?rev=1351866&r1=1351865&r2=1351866&view=diff
==============================================================================
--- ofbiz/branches/20120329_portletWidget/applications/order/webapp/ordermgr/WEB-INF/actions/entry/ShipSettings.groovy (original)
+++ ofbiz/branches/20120329_portletWidget/applications/order/webapp/ordermgr/WEB-INF/actions/entry/ShipSettings.groovy Tue Jun 19 21:36:11 2012
@@ -49,7 +49,7 @@ if ("SALES_ORDER".equals(cart.getOrderTy
         orderParty = delegator.findOne("Party", [partyId : orderPartyId], false);
         if (orderParty) {
             shippingContactMechList = ContactHelper.getContactMech(orderParty, "SHIPPING_LOCATION", "POSTAL_ADDRESS", false);
-            orderPerson = orderParty.getRelatedOne("Person");
+            orderPerson = orderParty.getRelatedOne("Person", false);
             context.orderParty = orderParty;
             context.orderPerson = orderPerson;
             context.shippingContactMechList = shippingContactMechList;
@@ -76,7 +76,7 @@ if ("SALES_ORDER".equals(cart.getOrderTy
     if (!"_NA_".equals(orderPartyId)) {
         orderParty = delegator.findOne("Party", [partyId : orderPartyId], false);
         if (orderParty) {
-           orderPerson = orderParty.getRelatedOne("Person");
+           orderPerson = orderParty.getRelatedOne("Person", false);
            context.orderParty = orderParty;
            context.orderPerson = orderPerson;
          }

Modified: ofbiz/branches/20120329_portletWidget/applications/order/webapp/ordermgr/WEB-INF/actions/entry/StorePaymentOptions.groovy
URL: http://svn.apache.org/viewvc/ofbiz/branches/20120329_portletWidget/applications/order/webapp/ordermgr/WEB-INF/actions/entry/StorePaymentOptions.groovy?rev=1351866&r1=1351865&r2=1351866&view=diff
==============================================================================
--- ofbiz/branches/20120329_portletWidget/applications/order/webapp/ordermgr/WEB-INF/actions/entry/StorePaymentOptions.groovy (original)
+++ ofbiz/branches/20120329_portletWidget/applications/order/webapp/ordermgr/WEB-INF/actions/entry/StorePaymentOptions.groovy Tue Jun 19 21:36:11 2012
@@ -24,7 +24,7 @@ import org.ofbiz.product.store.*;
 productStore = ProductStoreWorker.getProductStore(request);
 
 productStorePaymentMethodTypeIdMap = new HashMap();
-productStorePaymentSettingList = productStore.getRelatedCache("ProductStorePaymentSetting");
+productStorePaymentSettingList = productStore.getRelated("ProductStorePaymentSetting", null, null, true);
 productStorePaymentSettingIter = productStorePaymentSettingList.iterator();
 while (productStorePaymentSettingIter.hasNext()) {
     productStorePaymentSetting = productStorePaymentSettingIter.next();

Modified: ofbiz/branches/20120329_portletWidget/applications/order/webapp/ordermgr/WEB-INF/actions/entry/catalog/CompareProducts.groovy
URL: http://svn.apache.org/viewvc/ofbiz/branches/20120329_portletWidget/applications/order/webapp/ordermgr/WEB-INF/actions/entry/catalog/CompareProducts.groovy?rev=1351866&r1=1351865&r2=1351866&view=diff
==============================================================================
--- ofbiz/branches/20120329_portletWidget/applications/order/webapp/ordermgr/WEB-INF/actions/entry/catalog/CompareProducts.groovy (original)
+++ ofbiz/branches/20120329_portletWidget/applications/order/webapp/ordermgr/WEB-INF/actions/entry/catalog/CompareProducts.groovy Tue Jun 19 21:36:11 2012
@@ -64,7 +64,7 @@ compareList.each { product ->
     cond = EntityCondition.makeCondition(condList);
     productFeatureAppls = delegator.findList("ProductFeatureAppl", cond, null, ["sequenceNum"], null, true);
     productFeatureAppls.each { productFeatureAppl ->
-        productFeature = productFeatureAppl.getRelatedOneCache("ProductFeature");
+        productFeature = productFeatureAppl.getRelatedOne("ProductFeature", true);
         if (!productData[productFeature.productFeatureTypeId]) {
             productData[productFeature.productFeatureTypeId] = [:];
         }

Modified: ofbiz/branches/20120329_portletWidget/applications/order/webapp/ordermgr/WEB-INF/actions/entry/catalog/InlineProductDetail.groovy
URL: http://svn.apache.org/viewvc/ofbiz/branches/20120329_portletWidget/applications/order/webapp/ordermgr/WEB-INF/actions/entry/catalog/InlineProductDetail.groovy?rev=1351866&r1=1351865&r2=1351866&view=diff
==============================================================================
--- ofbiz/branches/20120329_portletWidget/applications/order/webapp/ordermgr/WEB-INF/actions/entry/catalog/InlineProductDetail.groovy (original)
+++ ofbiz/branches/20120329_portletWidget/applications/order/webapp/ordermgr/WEB-INF/actions/entry/catalog/InlineProductDetail.groovy Tue Jun 19 21:36:11 2012
@@ -283,7 +283,7 @@ if (inlineProduct) {
                         }
                         numberFormat = NumberFormat.getCurrencyInstance(locale);
                         variants.each { variantAssoc ->
-                            variant = variantAssoc.getRelatedOne("AssocProduct");
+                            variant = variantAssoc.getRelatedOne("AssocProduct", false);
                             // Get the price for each variant. Reuse the priceContext already setup for virtual product above and replace the product
                             if (cart.isSalesOrder()) {
                                 // sales order: run the "calculateProductPrice" service

Modified: ofbiz/branches/20120329_portletWidget/applications/order/webapp/ordermgr/WEB-INF/actions/entry/catalog/Product.groovy
URL: http://svn.apache.org/viewvc/ofbiz/branches/20120329_portletWidget/applications/order/webapp/ordermgr/WEB-INF/actions/entry/catalog/Product.groovy?rev=1351866&r1=1351865&r2=1351866&view=diff
==============================================================================
--- ofbiz/branches/20120329_portletWidget/applications/order/webapp/ordermgr/WEB-INF/actions/entry/catalog/Product.groovy (original)
+++ ofbiz/branches/20120329_portletWidget/applications/order/webapp/ordermgr/WEB-INF/actions/entry/catalog/Product.groovy Tue Jun 19 21:36:11 2012
@@ -50,7 +50,7 @@ if (productId) {
             virtualVariantProductAssocs = EntityUtil.filterByDate(virtualVariantProductAssocs);
             if (virtualVariantProductAssocs) {
                 productAssoc = EntityUtil.getFirst(virtualVariantProductAssocs);
-                product = productAssoc.getRelatedOneCache("AssocProduct");
+                product = productAssoc.getRelatedOne("AssocProduct", true);
             }
         }
     }
@@ -112,7 +112,7 @@ if (productId) {
             keywords.add(catalogName);
             members = delegator.findByAnd("ProductCategoryMember", [productId : productId], null, true);
             members.each { member ->
-                category = member.getRelatedOneCache("ProductCategory");
+                category = member.getRelatedOne("ProductCategory", true);
                 if (category.description) {
                     categoryContentWrapper = new CategoryContentWrapper(category, request);
                     categoryDescription = categoryContentWrapper.DESCRIPTION;

Modified: ofbiz/branches/20120329_portletWidget/applications/order/webapp/ordermgr/WEB-INF/actions/entry/catalog/ProductDetail.groovy
URL: http://svn.apache.org/viewvc/ofbiz/branches/20120329_portletWidget/applications/order/webapp/ordermgr/WEB-INF/actions/entry/catalog/ProductDetail.groovy?rev=1351866&r1=1351865&r2=1351866&view=diff
==============================================================================
--- ofbiz/branches/20120329_portletWidget/applications/order/webapp/ordermgr/WEB-INF/actions/entry/catalog/ProductDetail.groovy (original)
+++ ofbiz/branches/20120329_portletWidget/applications/order/webapp/ordermgr/WEB-INF/actions/entry/catalog/ProductDetail.groovy Tue Jun 19 21:36:11 2012
@@ -193,7 +193,7 @@ if (product) {
     if (cart.isSalesOrder()) {
         reviewByAnd.productStoreId = productStoreId;
     }
-    reviews = product.getRelatedCache("ProductReview", reviewByAnd, ["-postedDateTime"]);
+    reviews = product.getRelated("ProductReview", reviewByAnd, ["-postedDateTime"], true);
     context.productReviews = reviews;
     // get the average rating
     if (reviews) {
@@ -247,8 +247,8 @@ if (product) {
         if(productVirtualVariants){
             productVirtualVariants.each { virtualVariantKey ->
                 mainProductMap = [:];
-                mainProduct = virtualVariantKey.getRelatedOneCache("MainProduct");
-                quantityUom = mainProduct.getRelatedOneCache("QuantityUom");
+                mainProduct = virtualVariantKey.getRelatedOne("MainProduct", true);
+                quantityUom = mainProduct.getRelatedOne("QuantityUom", true);
                 mainProductMap.productId = mainProduct.productId;
                 mainProductMap.piecesIncluded = mainProduct.piecesIncluded;
                 mainProductMap.uomDesc = quantityUom.description;
@@ -404,7 +404,7 @@ if (product) {
                         }
                         numberFormat = NumberFormat.getCurrencyInstance(locale);
                         variants.each { variantAssoc ->
-                            variant = variantAssoc.getRelatedOne("AssocProduct");
+                            variant = variantAssoc.getRelatedOne("AssocProduct", false);
                             // Get the price for each variant. Reuse the priceContext already setup for virtual product above and replace the product
                             priceContext.product = variant;
                             if (cart.isSalesOrder()) {
@@ -448,7 +448,7 @@ if (product) {
                             
                             if(virtualVariants){
                                 virtualVariants.each { virtualAssoc ->
-                                    virtual = virtualAssoc.getRelatedOne("MainProduct");
+                                    virtual = virtualAssoc.getRelatedOne("MainProduct", false);
                                     // Get price from a virtual product
                                     priceContext.product = virtual;
                                     if (cart.isSalesOrder()) {
@@ -526,7 +526,7 @@ if (product) {
                 variantPriceJS.append("function getVariantPrice(sku) { ");
                 
                 virtualVariants.each { virtualAssoc ->
-                    virtual = virtualAssoc.getRelatedOne("MainProduct");
+                    virtual = virtualAssoc.getRelatedOne("MainProduct", false);
                     // Get price from a virtual product
                     priceContext.product = virtual;
                     if (cart.isSalesOrder()) {