You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ofbiz.apache.org by do...@apache.org on 2012/05/12 23:19:11 UTC
svn commit: r1337668 - in /ofbiz/trunk/applications/manufacturing:
src/org/ofbiz/manufacturing/bom/ src/org/ofbiz/manufacturing/jobshopmgt/
src/org/ofbiz/manufacturing/mrp/ src/org/ofbiz/manufacturing/routing/
src/org/ofbiz/manufacturing/techdata/ weba...
Author: doogie
Date: Sat May 12 21:19:10 2012
New Revision: 1337668
URL: http://svn.apache.org/viewvc?rev=1337668&view=rev
Log:
DEPRECATION: applications/manufacturing: findByPrimaryKey variants
replaced with findOne
Modified:
ofbiz/trunk/applications/manufacturing/src/org/ofbiz/manufacturing/bom/BOMNode.java
ofbiz/trunk/applications/manufacturing/src/org/ofbiz/manufacturing/bom/BOMServices.java
ofbiz/trunk/applications/manufacturing/src/org/ofbiz/manufacturing/bom/BOMTree.java
ofbiz/trunk/applications/manufacturing/src/org/ofbiz/manufacturing/jobshopmgt/ProductionRun.java
ofbiz/trunk/applications/manufacturing/src/org/ofbiz/manufacturing/jobshopmgt/ProductionRunHelper.java
ofbiz/trunk/applications/manufacturing/src/org/ofbiz/manufacturing/jobshopmgt/ProductionRunServices.java
ofbiz/trunk/applications/manufacturing/src/org/ofbiz/manufacturing/mrp/InventoryEventPlannedServices.java
ofbiz/trunk/applications/manufacturing/src/org/ofbiz/manufacturing/mrp/MrpServices.java
ofbiz/trunk/applications/manufacturing/src/org/ofbiz/manufacturing/mrp/ProposedOrder.java
ofbiz/trunk/applications/manufacturing/src/org/ofbiz/manufacturing/routing/RoutingServices.java
ofbiz/trunk/applications/manufacturing/src/org/ofbiz/manufacturing/techdata/TechDataServices.java
ofbiz/trunk/applications/manufacturing/webapp/manufacturing/WEB-INF/actions/bom/EditProductBom.groovy
ofbiz/trunk/applications/manufacturing/webapp/manufacturing/WEB-INF/actions/jobshopmgt/ProductionRunDeclaration.groovy
ofbiz/trunk/applications/manufacturing/webapp/manufacturing/WEB-INF/actions/jobshopmgt/WorkWithShipmentPlans.groovy
ofbiz/trunk/applications/manufacturing/webapp/manufacturing/WEB-INF/actions/reports/PRunsComponentsByFeature.groovy
ofbiz/trunk/applications/manufacturing/webapp/manufacturing/WEB-INF/actions/reports/PRunsInfoAndOrder.groovy
ofbiz/trunk/applications/manufacturing/webapp/manufacturing/WEB-INF/actions/reports/PRunsProductsAndOrder.groovy
ofbiz/trunk/applications/manufacturing/webapp/manufacturing/WEB-INF/actions/reports/PRunsProductsByFeature.groovy
ofbiz/trunk/applications/manufacturing/webapp/manufacturing/WEB-INF/actions/reports/PRunsProductsStacks.groovy
ofbiz/trunk/applications/manufacturing/webapp/manufacturing/WEB-INF/actions/reports/PackageContentsAndOrder.groovy
ofbiz/trunk/applications/manufacturing/webapp/manufacturing/WEB-INF/actions/reports/ShipmentLabel.groovy
ofbiz/trunk/applications/manufacturing/webapp/manufacturing/WEB-INF/actions/reports/ShipmentPlanStockReport.groovy
ofbiz/trunk/applications/manufacturing/webapp/manufacturing/WEB-INF/actions/reports/ShipmentWorkEffortTasks.groovy
ofbiz/trunk/applications/manufacturing/webapp/manufacturing/WEB-INF/actions/routing/EditCalendar.groovy
ofbiz/trunk/applications/manufacturing/webapp/manufacturing/WEB-INF/actions/routing/EditCalendarExceptionDay.groovy
ofbiz/trunk/applications/manufacturing/webapp/manufacturing/WEB-INF/actions/routing/EditCalendarExceptionWeek.groovy
ofbiz/trunk/applications/manufacturing/webapp/manufacturing/bom/EditProductBom.ftl
ofbiz/trunk/applications/manufacturing/webapp/manufacturing/jobshopmgt/ShowProductionRun.groovy
ofbiz/trunk/applications/manufacturing/webapp/manufacturing/mrp/findInventoryEventPlan.ftl
Modified: ofbiz/trunk/applications/manufacturing/src/org/ofbiz/manufacturing/bom/BOMNode.java
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/manufacturing/src/org/ofbiz/manufacturing/bom/BOMNode.java?rev=1337668&r1=1337667&r2=1337668&view=diff
==============================================================================
--- ofbiz/trunk/applications/manufacturing/src/org/ofbiz/manufacturing/bom/BOMNode.java (original)
+++ ofbiz/trunk/applications/manufacturing/src/org/ofbiz/manufacturing/bom/BOMNode.java Sat May 12 21:19:10 2012
@@ -86,7 +86,7 @@ public class BOMNode {
}
public BOMNode(String productId, Delegator delegator, LocalDispatcher dispatcher, GenericValue userLogin) throws GenericEntityException {
- this(delegator.findByPrimaryKey("Product", UtilMisc.toMap("productId", productId)), dispatcher, userLogin);
+ this(delegator.findOne("Product", UtilMisc.toMap("productId", productId), false), dispatcher, userLogin);
}
protected void loadChildren(String partBomTypeId, Date inDate, List<GenericValue> productFeatures, int type) throws GenericEntityException {
Modified: ofbiz/trunk/applications/manufacturing/src/org/ofbiz/manufacturing/bom/BOMServices.java
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/manufacturing/src/org/ofbiz/manufacturing/bom/BOMServices.java?rev=1337668&r1=1337667&r2=1337668&view=diff
==============================================================================
--- ofbiz/trunk/applications/manufacturing/src/org/ofbiz/manufacturing/bom/BOMServices.java (original)
+++ ofbiz/trunk/applications/manufacturing/src/org/ofbiz/manufacturing/bom/BOMServices.java Sat May 12 21:19:10 2012
@@ -136,7 +136,7 @@ public class BOMServices {
Long llc = null;
try {
- GenericValue product = delegator.findByPrimaryKey("Product", UtilMisc.toMap("productId", productId));
+ GenericValue product = delegator.findOne("Product", UtilMisc.toMap("productId", productId), false);
Map<String, Object> depthResult = dispatcher.runSync("getMaxDepth",
UtilMisc.toMap("productId", productId, "bomType", "MANUF_COMPONENT"));
llc = (Long)depthResult.get("depth");
@@ -148,7 +148,7 @@ public class BOMServices {
int virtualMaxDepth = 0;
for(GenericValue oneVirtualProductAssoc : virtualProducts) {
int virtualDepth = 0;
- GenericValue virtualProduct = delegator.findByPrimaryKey("Product", UtilMisc.toMap("productId", oneVirtualProductAssoc.getString("productId")));
+ GenericValue virtualProduct = delegator.findOne("Product", UtilMisc.toMap("productId", oneVirtualProductAssoc.getString("productId")), false);
if (virtualProduct.get("billOfMaterialLevel") != null) {
virtualDepth = virtualProduct.getLong("billOfMaterialLevel").intValue();
} else {
@@ -186,7 +186,7 @@ public class BOMServices {
UtilMisc.toMap("productId", productId, "productAssocTypeId", "PRODUCT_VARIANT"));
variantProducts = EntityUtil.filterByDate(variantProducts, true);
for(GenericValue oneVariantProductAssoc : variantProducts) {
- GenericValue variantProduct = delegator.findByPrimaryKey("Product", UtilMisc.toMap("productId", oneVariantProductAssoc.getString("productId")));
+ GenericValue variantProduct = delegator.findOne("Product", UtilMisc.toMap("productId", oneVariantProductAssoc.getString("productId")), false);
variantProduct.set("billOfMaterialLevel", llc);
variantProduct.store();
}
@@ -576,7 +576,7 @@ public class BOMServices {
if (!boxTypes.containsKey(boxTypeId)) {
GenericValue boxType = null;
try {
- boxType = delegator.findByPrimaryKey("ShipmentBoxType", UtilMisc.toMap("shipmentBoxTypeId", boxTypeId));
+ boxType = delegator.findOne("ShipmentBoxType", UtilMisc.toMap("shipmentBoxTypeId", boxTypeId), false);
} catch (GenericEntityException e) {
return ServiceUtil.returnError(UtilProperties.getMessage(resource, "ManufacturingPackageConfiguratorError", locale));
}
@@ -605,7 +605,7 @@ public class BOMServices {
if (!boxTypes.containsKey(boxTypeId)) {
GenericValue boxType = null;
try {
- boxType = delegator.findByPrimaryKey("ShipmentBoxType", UtilMisc.toMap("shipmentBoxTypeId", boxTypeId));
+ boxType = delegator.findOne("ShipmentBoxType", UtilMisc.toMap("shipmentBoxTypeId", boxTypeId), false);
} catch (GenericEntityException e) {
return ServiceUtil.returnError(UtilProperties.getMessage(resource, "ManufacturingPackageConfiguratorError", locale));
}
Modified: ofbiz/trunk/applications/manufacturing/src/org/ofbiz/manufacturing/bom/BOMTree.java
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/manufacturing/src/org/ofbiz/manufacturing/bom/BOMTree.java?rev=1337668&r1=1337667&r2=1337668&view=diff
==============================================================================
--- ofbiz/trunk/applications/manufacturing/src/org/ofbiz/manufacturing/bom/BOMTree.java (original)
+++ ofbiz/trunk/applications/manufacturing/src/org/ofbiz/manufacturing/bom/BOMTree.java Sat May 12 21:19:10 2012
@@ -97,7 +97,7 @@ public class BOMTree {
this.delegator = delegator;
this.dispatcher = dispatcher;
- inputProduct = delegator.findByPrimaryKey("Product", UtilMisc.toMap("productId", productId));
+ inputProduct = delegator.findOne("Product", UtilMisc.toMap("productId", productId), false);
String productIdForRules = productId;
// The selected product features are loaded
@@ -107,8 +107,8 @@ public class BOMTree {
GenericValue oneProductFeatureAppl = null;
for (int i = 0; i < productFeaturesAppl.size(); i++) {
oneProductFeatureAppl = productFeaturesAppl.get(i);
- productFeatures.add(delegator.findByPrimaryKey("ProductFeature",
- UtilMisc.toMap("productFeatureId", oneProductFeatureAppl.getString("productFeatureId"))));
+ productFeatures.add(delegator.findOne("ProductFeature",
+ UtilMisc.toMap("productFeatureId", oneProductFeatureAppl.getString("productFeatureId")), false));
}
// If the product is manufactured as a different product,
@@ -116,8 +116,8 @@ public class BOMTree {
GenericValue manufacturedAsProduct = manufacturedAsProduct(productId, inDate);
// We load the information about the product that needs to be manufactured
// from Product entity
- GenericValue product = delegator.findByPrimaryKey("Product",
- UtilMisc.toMap("productId", (manufacturedAsProduct != null? manufacturedAsProduct.getString("productIdTo"): productId)));
+ GenericValue product = delegator.findOne("Product",
+ UtilMisc.toMap("productId", (manufacturedAsProduct != null? manufacturedAsProduct.getString("productIdTo"): productId)), false);
if (product == null) return;
BOMNode originalNode = new BOMNode(product, dispatcher, userLogin);
originalNode.setTree(this);
@@ -133,8 +133,8 @@ public class BOMTree {
// load the new product
productIdForRules = virtualProduct.getString("productId");
manufacturedAsProduct = manufacturedAsProduct(virtualProduct.getString("productId"), inDate);
- product = delegator.findByPrimaryKey("Product",
- UtilMisc.toMap("productId", (manufacturedAsProduct != null? manufacturedAsProduct.getString("productIdTo"): virtualProduct.get("productId"))));
+ product = delegator.findOne("Product",
+ UtilMisc.toMap("productId", (manufacturedAsProduct != null? manufacturedAsProduct.getString("productIdTo"): virtualProduct.get("productId"))), false);
}
}
if (product == null) return;
@@ -334,7 +334,7 @@ public class BOMTree {
if (root != null) {
if (UtilValidate.isEmpty(facilityId)) {
if (orderId != null) {
- GenericValue order = delegator.findByPrimaryKey("OrderHeader", UtilMisc.toMap("orderId", orderId));
+ GenericValue order = delegator.findOne("OrderHeader", UtilMisc.toMap("orderId", orderId), false);
String productStoreId = order.getString("productStoreId");
if (productStoreId != null) {
GenericValue productStore = ProductStoreWorker.getProductStore(productStoreId, delegator);
@@ -345,7 +345,7 @@ public class BOMTree {
}
if (facilityId == null && shipmentId != null) {
- GenericValue shipment = delegator.findByPrimaryKey("Shipment", UtilMisc.toMap("shipmentId", shipmentId));
+ GenericValue shipment = delegator.findOne("Shipment", UtilMisc.toMap("shipmentId", shipmentId), false);
facilityId = shipment.getString("originFacilityId");
}
}
Modified: ofbiz/trunk/applications/manufacturing/src/org/ofbiz/manufacturing/jobshopmgt/ProductionRun.java
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/manufacturing/src/org/ofbiz/manufacturing/jobshopmgt/ProductionRun.java?rev=1337668&r1=1337667&r2=1337668&view=diff
==============================================================================
--- ofbiz/trunk/applications/manufacturing/src/org/ofbiz/manufacturing/jobshopmgt/ProductionRun.java (original)
+++ ofbiz/trunk/applications/manufacturing/src/org/ofbiz/manufacturing/jobshopmgt/ProductionRun.java Sat May 12 21:19:10 2012
@@ -76,11 +76,11 @@ public class ProductionRun {
try {
if (! UtilValidate.isEmpty(productionRunId)) {
this.dispatcher = dispatcher;
- GenericValue workEffort = delegator.findByPrimaryKey("WorkEffort", UtilMisc.toMap("workEffortId", productionRunId));
+ GenericValue workEffort = delegator.findOne("WorkEffort", UtilMisc.toMap("workEffortId", productionRunId), false);
if (workEffort != null) {
// If this is a task, get the parent production run
if (workEffort.getString("workEffortTypeId") != null && "PROD_ORDER_TASK".equals(workEffort.getString("workEffortTypeId"))) {
- workEffort = delegator.findByPrimaryKey("WorkEffort", UtilMisc.toMap("workEffortId", workEffort.getString("workEffortParentId")));
+ workEffort = delegator.findOne("WorkEffort", UtilMisc.toMap("workEffortId", workEffort.getString("workEffortParentId")), false);
}
}
this.productionRun = workEffort;
Modified: ofbiz/trunk/applications/manufacturing/src/org/ofbiz/manufacturing/jobshopmgt/ProductionRunHelper.java
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/manufacturing/src/org/ofbiz/manufacturing/jobshopmgt/ProductionRunHelper.java?rev=1337668&r1=1337667&r2=1337668&view=diff
==============================================================================
--- ofbiz/trunk/applications/manufacturing/src/org/ofbiz/manufacturing/jobshopmgt/ProductionRunHelper.java (original)
+++ ofbiz/trunk/applications/manufacturing/src/org/ofbiz/manufacturing/jobshopmgt/ProductionRunHelper.java Sat May 12 21:19:10 2012
@@ -57,7 +57,7 @@ public class ProductionRunHelper {
try {
if (productionRunId != null) {
- GenericValue productionRun = delegator.findByPrimaryKey("WorkEffort", UtilMisc.toMap("workEffortId", productionRunId));
+ GenericValue productionRun = delegator.findOne("WorkEffort", UtilMisc.toMap("workEffortId", productionRunId), false);
if (productionRun != null) {
List<GenericValue> productionRunProducts = productionRun.getRelated("WorkEffortGoodStandard", UtilMisc.toMap("workEffortGoodStdTypeId", "PRUN_PROD_DELIV"),null);
GenericValue productionRunProduct = EntityUtil.getFirst(productionRunProducts);
Modified: ofbiz/trunk/applications/manufacturing/src/org/ofbiz/manufacturing/jobshopmgt/ProductionRunServices.java
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/manufacturing/src/org/ofbiz/manufacturing/jobshopmgt/ProductionRunServices.java?rev=1337668&r1=1337667&r2=1337668&view=diff
==============================================================================
--- ofbiz/trunk/applications/manufacturing/src/org/ofbiz/manufacturing/jobshopmgt/ProductionRunServices.java (original)
+++ ofbiz/trunk/applications/manufacturing/src/org/ofbiz/manufacturing/jobshopmgt/ProductionRunServices.java Sat May 12 21:19:10 2012
@@ -204,7 +204,7 @@ public class ProductionRunServices {
List<GenericValue> routingTaskAssocs = null;
try {
// Find the product
- product = delegator.findByPrimaryKey("Product", UtilMisc.toMap("productId", productId));
+ product = delegator.findOne("Product", UtilMisc.toMap("productId", productId), false);
if (product == null) {
return ServiceUtil.returnError(UtilProperties.getMessage(resource, "ManufacturingProductNotExist", locale));
}
@@ -969,7 +969,7 @@ public class ProductionRunServices {
String workEffortId = (String)context.get("workEffortId");
Locale locale = (Locale) context.get("locale");
try {
- GenericValue workEffort = delegator.findByPrimaryKey("WorkEffort", UtilMisc.toMap("workEffortId", workEffortId));
+ GenericValue workEffort = delegator.findOne("WorkEffort", UtilMisc.toMap("workEffortId", workEffortId), false);
if (workEffort == null) {
return ServiceUtil.returnError(UtilProperties.getMessage(resource, "ManufacturingWorkEffortNotExist", locale) + " " + workEffortId);
}
@@ -1033,7 +1033,7 @@ public class ProductionRunServices {
// this is the id of the actual (real) production run task
String productionRunTaskId = (String)context.get("productionRunTaskId");
try {
- GenericValue workEffort = delegator.findByPrimaryKey("WorkEffort", UtilMisc.toMap("workEffortId", productionRunTaskId));
+ GenericValue workEffort = delegator.findOne("WorkEffort", UtilMisc.toMap("workEffortId", productionRunTaskId), false);
if (UtilValidate.isEmpty(workEffort)) {
return ServiceUtil.returnError(UtilProperties.getMessage(resource, "ManufacturingProductionRunTaskNotFound", UtilMisc.toMap("productionRunTaskId", productionRunTaskId), locale));
}
@@ -1295,7 +1295,7 @@ public class ProductionRunServices {
try {
// Find the product
- GenericValue product = delegator.findByPrimaryKey("Product", UtilMisc.toMap("productId", productId));
+ GenericValue product = delegator.findOne("Product", UtilMisc.toMap("productId", productId), false);
if (product == null) {
return ServiceUtil.returnError(UtilProperties.getMessage(resource, "ManufacturingProductNotExist", locale));
}
@@ -1369,7 +1369,7 @@ public class ProductionRunServices {
try {
// Find the product
- GenericValue product = delegator.findByPrimaryKey("Product", UtilMisc.toMap("productId", productId));
+ GenericValue product = delegator.findOne("Product", UtilMisc.toMap("productId", productId), false);
if (product == null) {
return ServiceUtil.returnError(UtilProperties.getMessage(resource, "ManufacturingProductNotExist", locale));
}
@@ -1438,7 +1438,7 @@ public class ProductionRunServices {
// The routing task is loaded
GenericValue routingTask = null;
try {
- routingTask = delegator.findByPrimaryKey("WorkEffort", UtilMisc.toMap("workEffortId", routingTaskId));
+ routingTask = delegator.findOne("WorkEffort", UtilMisc.toMap("workEffortId", routingTaskId), false);
} catch (GenericEntityException e) {
Debug.logError(e.getMessage(), module);
return ServiceUtil.returnError(UtilProperties.getMessage(resource, "ManufacturingRoutingTaskNotExists", locale));
@@ -1607,7 +1607,7 @@ public class ProductionRunServices {
if (UtilValidate.isNotEmpty(lotId)) {
try {
// Find the lot
- GenericValue lot = delegator.findByPrimaryKey("Lot", UtilMisc.toMap("lotId", lotId));
+ GenericValue lot = delegator.findOne("Lot", UtilMisc.toMap("lotId", lotId), false);
if (lot == null) {
if (createLotIfNeeded.booleanValue()) {
lot = delegator.makeValue("Lot", UtilMisc.toMap("lotId", lotId, "creationDate", UtilDateTime.nowTimestamp()));
@@ -2177,7 +2177,7 @@ public class ProductionRunServices {
String requirementId = (String)context.get("requirementId");
GenericValue requirement = null;
try {
- requirement = delegator.findByPrimaryKey("Requirement", UtilMisc.toMap("requirementId", requirementId));
+ requirement = delegator.findOne("Requirement", UtilMisc.toMap("requirementId", requirementId), false);
} catch (GenericEntityException gee) {
}
@@ -2208,7 +2208,7 @@ public class ProductionRunServices {
GenericValue requirement = null;
try {
- requirement = delegator.findByPrimaryKey("Requirement", UtilMisc.toMap("requirementId", requirementId));
+ requirement = delegator.findOne("Requirement", UtilMisc.toMap("requirementId", requirementId), false);
} catch (GenericEntityException gee) {
}
if (requirement == null) {
@@ -2431,7 +2431,7 @@ public class ProductionRunServices {
// hasn't been reserved and ATP not yet decreased
boolean isImmediatelyFulfilled = false;
try {
- GenericValue order = delegator.findByPrimaryKey("OrderHeader", UtilMisc.toMap("orderId", orderId));
+ GenericValue order = delegator.findOne("OrderHeader", UtilMisc.toMap("orderId", orderId), false);
GenericValue productStore = delegator.getRelatedOne("ProductStore", order);
isImmediatelyFulfilled = "Y".equals(productStore.getString("isImmediatelyFulfilled"));
} catch (GenericEntityException e) {
@@ -2440,7 +2440,7 @@ public class ProductionRunServices {
GenericValue orderItem = null;
try {
- orderItem = delegator.findByPrimaryKey("OrderItem", UtilMisc.toMap("orderId", orderId, "orderItemSeqId", orderItemSeqId));
+ orderItem = delegator.findOne("OrderItem", UtilMisc.toMap("orderId", orderId, "orderItemSeqId", orderItemSeqId), false);
} catch (GenericEntityException e) {
return ServiceUtil.returnError(UtilProperties.getMessage(resource, "ManufacturingProductionRunForMarketingPackagesCreationError", UtilMisc.toMap("orderId", orderId, "orderItemSeqId", orderItemSeqId, "errorString", e.getMessage()), locale));
}
@@ -2558,9 +2558,9 @@ public class ProductionRunServices {
try {
GenericValue orderItem = null;
if (UtilValidate.isNotEmpty(shipGroupSeqId)) {
- orderItem = delegator.findByPrimaryKey("OrderItemShipGroupAssoc", UtilMisc.toMap("orderId", orderId, "orderItemSeqId", orderItemSeqId, "shipGroupSeqId", shipGroupSeqId));
+ orderItem = delegator.findOne("OrderItemShipGroupAssoc", UtilMisc.toMap("orderId", orderId, "orderItemSeqId", orderItemSeqId, "shipGroupSeqId", shipGroupSeqId), false);
} else {
- orderItem = delegator.findByPrimaryKey("OrderItem", UtilMisc.toMap("orderId", orderId, "orderItemSeqId", orderItemSeqId));
+ orderItem = delegator.findOne("OrderItem", UtilMisc.toMap("orderId", orderId, "orderItemSeqId", orderItemSeqId), false);
}
if (orderItem == null) {
return ServiceUtil.returnError(UtilProperties.getMessage(resourceOrder, "OrderErrorOrderItemNotFound", UtilMisc.toMap("orderId", orderId, "orderItemSeqId", ""), locale));
@@ -2702,7 +2702,7 @@ public class ProductionRunServices {
try {
Map<String, Object> serviceContext = FastMap.newInstance();
Map<String, Object> resultService = null;
- GenericValue task = delegator.findByPrimaryKey("WorkEffort", UtilMisc.toMap("workEffortId", taskId));
+ GenericValue task = delegator.findOne("WorkEffort", UtilMisc.toMap("workEffortId", taskId), false);
String currentStatusId = task.getString("currentStatusId");
String prevStatusId = "";
while (!"PRUN_COMPLETED".equals(currentStatusId)) {
@@ -2935,7 +2935,7 @@ public class ProductionRunServices {
}
*/
try {
- GenericValue inventoryItem = delegator.findByPrimaryKey("InventoryItem", UtilMisc.toMap("inventoryItemId", inventoryItemId));
+ GenericValue inventoryItem = delegator.findOne("InventoryItem", UtilMisc.toMap("inventoryItemId", inventoryItemId), false);
if (inventoryItem == null) {
return ServiceUtil.returnError(UtilProperties.getMessage(resourceProduct, "ProductInventoryItemNotFound", UtilMisc.toMap("inventoryItemId", inventoryItemId), locale));
}
@@ -2975,8 +2975,8 @@ public class ProductionRunServices {
BigDecimal quantity = (BigDecimal)context.get("quantity");
List<String> inventoryItemIds = FastList.newInstance();
try {
- GenericValue inventoryItem = delegator.findByPrimaryKey("InventoryItem",
- UtilMisc.toMap("inventoryItemId", inventoryItemId));
+ GenericValue inventoryItem = delegator.findOne("InventoryItem",
+ UtilMisc.toMap("inventoryItemId", inventoryItemId), false);
if (inventoryItem == null) {
return ServiceUtil.returnError(UtilProperties.getMessage(resource, "ManufacturingProductionRunCannotDecomposingInventoryItem", UtilMisc.toMap("inventoryItemId", inventoryItemId), locale));
}
@@ -3128,7 +3128,7 @@ public class ProductionRunServices {
orderDeliverySchedule = null;
orderId = newOrderId;
try {
- orderDeliverySchedule = delegator.findByPrimaryKey("OrderDeliverySchedule", UtilMisc.toMap("orderId", orderId, "orderItemSeqId", "_NA_"));
+ orderDeliverySchedule = delegator.findOne("OrderDeliverySchedule", UtilMisc.toMap("orderId", orderId, "orderItemSeqId", "_NA_"), false);
} catch (GenericEntityException e) {
}
}
@@ -3136,7 +3136,7 @@ public class ProductionRunServices {
BigDecimal orderQuantity = genericResult.getBigDecimal("quantity");
GenericValue orderItemDeliverySchedule = null;
try {
- orderItemDeliverySchedule = delegator.findByPrimaryKey("OrderDeliverySchedule", UtilMisc.toMap("orderId", orderId, "orderItemSeqId", genericResult.getString("orderItemSeqId")));
+ orderItemDeliverySchedule = delegator.findOne("OrderDeliverySchedule", UtilMisc.toMap("orderId", orderId, "orderItemSeqId", genericResult.getString("orderItemSeqId")), false);
} catch (GenericEntityException e) {
}
Timestamp estimatedShipDate = null;
@@ -3175,8 +3175,8 @@ public class ProductionRunServices {
UtilMisc.toList("shipBeforeDate"), null, false);
for(GenericValue genericResult : backorders) {
String productId = genericResult.getString("productId");
- GenericValue orderItemShipGroup = delegator.findByPrimaryKey("OrderItemShipGroup", UtilMisc.toMap("orderId", genericResult.get("orderId"),
- "shipGroupSeqId", genericResult.get("shipGroupSeqId")));
+ GenericValue orderItemShipGroup = delegator.findOne("OrderItemShipGroup", UtilMisc.toMap("orderId", genericResult.get("orderId"),
+ "shipGroupSeqId", genericResult.get("shipGroupSeqId")), false);
Timestamp requiredByDate = orderItemShipGroup.getTimestamp("shipByDate");
BigDecimal quantityNotAvailable = genericResult.getBigDecimal("quantityNotAvailable");
@@ -3201,11 +3201,11 @@ public class ProductionRunServices {
if (remainingQty.compareTo(quantityNotAvailableRem) >= 0) {
remainingQty = remainingQty.subtract(quantityNotAvailableRem);
currentDateMap.put("remainingQty", remainingQty);
- GenericValue orderItemShipGrpInvRes = delegator.findByPrimaryKey("OrderItemShipGrpInvRes",
+ GenericValue orderItemShipGrpInvRes = delegator.findOne("OrderItemShipGrpInvRes",
UtilMisc.toMap("orderId", genericResult.getString("orderId"),
"shipGroupSeqId", genericResult.getString("shipGroupSeqId"),
"orderItemSeqId", genericResult.getString("orderItemSeqId"),
- "inventoryItemId", genericResult.getString("inventoryItemId")));
+ "inventoryItemId", genericResult.getString("inventoryItemId")), false);
orderItemShipGrpInvRes.set("promisedDatetime", currentDate);
orderItemShipGrpInvRes.store();
// TODO: set the reservation
Modified: ofbiz/trunk/applications/manufacturing/src/org/ofbiz/manufacturing/mrp/InventoryEventPlannedServices.java
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/manufacturing/src/org/ofbiz/manufacturing/mrp/InventoryEventPlannedServices.java?rev=1337668&r1=1337667&r2=1337668&view=diff
==============================================================================
--- ofbiz/trunk/applications/manufacturing/src/org/ofbiz/manufacturing/mrp/InventoryEventPlannedServices.java (original)
+++ ofbiz/trunk/applications/manufacturing/src/org/ofbiz/manufacturing/mrp/InventoryEventPlannedServices.java Sat May 12 21:19:10 2012
@@ -57,7 +57,7 @@ public class InventoryEventPlannedServic
try {
createOrUpdateMrpEvent(parameters, quantity, (String)context.get("facilityId"), (String)context.get("eventName"), false, delegator);
} catch (GenericEntityException e) {
- Debug.logError(e,"Error : findByPrimaryKey(\"MrpEvent\", parameters =)"+parameters, module);
+ Debug.logError(e,"Error : findOne(\"MrpEvent\", parameters =)"+parameters, module);
return ServiceUtil.returnError(UtilProperties.getMessage(resource, "ManufacturingMrpCreateOrUpdateEvent", UtilMisc.toMap("parameters", parameters), locale));
}
return ServiceUtil.returnSuccess();
@@ -66,7 +66,7 @@ public class InventoryEventPlannedServic
public static void createOrUpdateMrpEvent(Map<String, Object> mrpEventKeyMap, BigDecimal newQuantity, String facilityId,
String eventName, boolean isLate, Delegator delegator) throws GenericEntityException {
GenericValue mrpEvent = null;
- mrpEvent = delegator.findByPrimaryKey("MrpEvent", mrpEventKeyMap);
+ mrpEvent = delegator.findOne("MrpEvent", mrpEventKeyMap, false);
if (mrpEvent == null) {
mrpEvent = delegator.makeValue("MrpEvent", mrpEventKeyMap);
mrpEvent.put("quantity", newQuantity.doubleValue());
Modified: ofbiz/trunk/applications/manufacturing/src/org/ofbiz/manufacturing/mrp/MrpServices.java
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/manufacturing/src/org/ofbiz/manufacturing/mrp/MrpServices.java?rev=1337668&r1=1337667&r2=1337668&view=diff
==============================================================================
--- ofbiz/trunk/applications/manufacturing/src/org/ofbiz/manufacturing/mrp/MrpServices.java (original)
+++ ofbiz/trunk/applications/manufacturing/src/org/ofbiz/manufacturing/mrp/MrpServices.java Sat May 12 21:19:10 2012
@@ -254,7 +254,7 @@ public class MrpServices {
orderDeliverySchedule = null;
orderId = newOrderId;
try {
- orderDeliverySchedule = delegator.findByPrimaryKey("OrderDeliverySchedule", UtilMisc.toMap("orderId", orderId, "orderItemSeqId", "_NA_"));
+ orderDeliverySchedule = delegator.findOne("OrderDeliverySchedule", UtilMisc.toMap("orderId", orderId, "orderItemSeqId", "_NA_"), false);
} catch (GenericEntityException e) {
}
}
@@ -281,7 +281,7 @@ public class MrpServices {
GenericValue orderItemDeliverySchedule = null;
try {
- orderItemDeliverySchedule = delegator.findByPrimaryKey("OrderDeliverySchedule", UtilMisc.toMap("orderId", orderId, "orderItemSeqId", genericResult.getString("orderItemSeqId")));
+ orderItemDeliverySchedule = delegator.findOne("OrderDeliverySchedule", UtilMisc.toMap("orderId", orderId, "orderItemSeqId", genericResult.getString("orderItemSeqId")), false);
} catch (GenericEntityException e) {
}
Timestamp estimatedShipDate = null;
@@ -552,7 +552,7 @@ public class MrpServices {
try {
InventoryEventPlannedServices.createOrUpdateMrpEvent(parameters, componentEventQuantity.negate(), null, product.get("productId") + ": " + eventDate, false, delegator);
} catch (GenericEntityException e) {
- Debug.logError("Error : findByPrimaryKey(\"MrpEvent\", parameters) ="+parameters+"--"+e.getMessage(), module);
+ Debug.logError("Error : findOne(\"MrpEvent\", parameters) ="+parameters+"--"+e.getMessage(), module);
logMrpError(mrpId, node.getProduct().getString("productId"), "Unable to create event (processBomComponent)", delegator);
}
}
@@ -591,7 +591,7 @@ public class MrpServices {
}
if (UtilValidate.isEmpty(facilityId)) {
try {
- GenericValue facilityGroup = delegator.findByPrimaryKey("FacilityGroup", UtilMisc.toMap("facilityGroupId", facilityGroupId));
+ GenericValue facilityGroup = delegator.findOne("FacilityGroup", UtilMisc.toMap("facilityGroupId", facilityGroupId), false);
if (UtilValidate.isEmpty(facilityGroup)) {
return ServiceUtil.returnError(UtilProperties.getMessage(resource, "ManufacturingMrpFacilityGroupIsNotValid", UtilMisc.toMap("facilityGroupId", facilityGroupId), locale));
}
@@ -751,7 +751,7 @@ public class MrpServices {
String routingId = (String)serviceResponse.get("workEffortId");
if (routingId != null) {
try {
- routing = delegator.findByPrimaryKey("WorkEffort", UtilMisc.toMap("workEffortId", routingId));
+ routing = delegator.findOne("WorkEffort", UtilMisc.toMap("workEffortId", routingId), false);
} catch (GenericEntityException e) {
return ServiceUtil.returnError(UtilProperties.getMessage(resource, "ManufacturingMrpCannotFindProductForEvent", locale));
}
Modified: ofbiz/trunk/applications/manufacturing/src/org/ofbiz/manufacturing/mrp/ProposedOrder.java
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/manufacturing/src/org/ofbiz/manufacturing/mrp/ProposedOrder.java?rev=1337668&r1=1337667&r2=1337668&view=diff
==============================================================================
--- ofbiz/trunk/applications/manufacturing/src/org/ofbiz/manufacturing/mrp/ProposedOrder.java (original)
+++ ofbiz/trunk/applications/manufacturing/src/org/ofbiz/manufacturing/mrp/ProposedOrder.java Sat May 12 21:19:10 2012
@@ -190,7 +190,7 @@ public class ProposedOrder {
// the product is purchased
// TODO: REVIEW this code
try {
- GenericValue techDataCalendar = product.getDelegator().findByPrimaryKeyCache("TechDataCalendar", UtilMisc.toMap("calendarId", "SUPPLIER"));
+ GenericValue techDataCalendar = product.getDelegator().findOne("TechDataCalendar", UtilMisc.toMap("calendarId", "SUPPLIER"), true);
startDate = TechDataServices.addBackward(techDataCalendar, endDate, timeToShip);
} catch (GenericEntityException e) {
Debug.logError(e, "Error : reading SUPPLIER TechDataCalendar: " + e.getMessage(), module);
Modified: ofbiz/trunk/applications/manufacturing/src/org/ofbiz/manufacturing/routing/RoutingServices.java
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/manufacturing/src/org/ofbiz/manufacturing/routing/RoutingServices.java?rev=1337668&r1=1337667&r2=1337668&view=diff
==============================================================================
--- ofbiz/trunk/applications/manufacturing/src/org/ofbiz/manufacturing/routing/RoutingServices.java (original)
+++ ofbiz/trunk/applications/manufacturing/src/org/ofbiz/manufacturing/routing/RoutingServices.java Sat May 12 21:19:10 2012
@@ -68,7 +68,7 @@ public class RoutingServices {
GenericValue task = null;
try {
- task = delegator.findByPrimaryKey("WorkEffort", UtilMisc.toMap("workEffortId", taskId));
+ task = delegator.findOne("WorkEffort", UtilMisc.toMap("workEffortId", taskId), false);
} catch (GenericEntityException gee) {
return ServiceUtil.returnError(UtilProperties.getMessage(resource, "ManufacturingRoutingErrorFindingTask", UtilMisc.toMap("taskId", taskId), locale));
}
Modified: ofbiz/trunk/applications/manufacturing/src/org/ofbiz/manufacturing/techdata/TechDataServices.java
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/manufacturing/src/org/ofbiz/manufacturing/techdata/TechDataServices.java?rev=1337668&r1=1337667&r2=1337668&view=diff
==============================================================================
--- ofbiz/trunk/applications/manufacturing/src/org/ofbiz/manufacturing/techdata/TechDataServices.java (original)
+++ ofbiz/trunk/applications/manufacturing/src/org/ofbiz/manufacturing/techdata/TechDataServices.java Sat May 12 21:19:10 2012
@@ -198,7 +198,7 @@ public class TechDataServices {
if (techDataCalendar == null) {
try {
Delegator delegator = routingTask.getDelegator();
- techDataCalendar = delegator.findByPrimaryKey("TechDataCalendar",UtilMisc.toMap("calendarId","DEFAULT"));
+ techDataCalendar = delegator.findOne("TechDataCalendar",UtilMisc.toMap("calendarId","DEFAULT"), false);
} catch (GenericEntityException e) {
Debug.logError("Pb reading TechDataCalendar DEFAULT"+e.getMessage(), module);
}
Modified: ofbiz/trunk/applications/manufacturing/webapp/manufacturing/WEB-INF/actions/bom/EditProductBom.groovy
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/manufacturing/webapp/manufacturing/WEB-INF/actions/bom/EditProductBom.groovy?rev=1337668&r1=1337667&r2=1337668&view=diff
==============================================================================
--- ofbiz/trunk/applications/manufacturing/webapp/manufacturing/WEB-INF/actions/bom/EditProductBom.groovy (original)
+++ ofbiz/trunk/applications/manufacturing/webapp/manufacturing/WEB-INF/actions/bom/EditProductBom.groovy Sat May 12 21:19:10 2012
@@ -44,7 +44,7 @@ Timestamp fromDate = null;
if (fromDateStr) fromDate = Timestamp.valueOf(fromDateStr) ?: (Timestamp)request.getAttribute("ProductAssocCreateFromDate");;
context.fromDate = fromDate;
-productAssoc = delegator.findByPrimaryKey("ProductAssoc", [productId : productId, productIdTo : productIdTo, productAssocTypeId : productAssocTypeId, fromDate : fromDate]);
+productAssoc = delegator.findOne("ProductAssoc", [productId : productId, productIdTo : productIdTo, productAssocTypeId : productAssocTypeId, fromDate : fromDate], false);
if (updateMode) {
productAssoc = [:];
context.remove("productIdTo");
Modified: ofbiz/trunk/applications/manufacturing/webapp/manufacturing/WEB-INF/actions/jobshopmgt/ProductionRunDeclaration.groovy
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/manufacturing/webapp/manufacturing/WEB-INF/actions/jobshopmgt/ProductionRunDeclaration.groovy?rev=1337668&r1=1337667&r2=1337668&view=diff
==============================================================================
--- ofbiz/trunk/applications/manufacturing/webapp/manufacturing/WEB-INF/actions/jobshopmgt/ProductionRunDeclaration.groovy (original)
+++ ofbiz/trunk/applications/manufacturing/webapp/manufacturing/WEB-INF/actions/jobshopmgt/ProductionRunDeclaration.groovy Sat May 12 21:19:10 2012
@@ -94,7 +94,7 @@ if (productionRunId) {
// routingTask update sub-screen
routingTaskId = parameters.routingTaskId;
if (routingTaskId && (actionForm.equals("UpdateRoutingTask") || actionForm.equals("EditRoutingTask"))) {
- routingTask = delegator.findByPrimaryKey("WorkEffort", [workEffortId : routingTaskId]);
+ routingTask = delegator.findOne("WorkEffort", [workEffortId : routingTaskId], false);
Map routingTaskData = routingTask.getAllFields();
routingTaskData.estimatedSetupMillis = routingTask.getDouble("estimatedSetupMillis");
routingTaskData.estimatedMilliSeconds = routingTask.getDouble("estimatedMilliSeconds");
Modified: ofbiz/trunk/applications/manufacturing/webapp/manufacturing/WEB-INF/actions/jobshopmgt/WorkWithShipmentPlans.groovy
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/manufacturing/webapp/manufacturing/WEB-INF/actions/jobshopmgt/WorkWithShipmentPlans.groovy?rev=1337668&r1=1337667&r2=1337668&view=diff
==============================================================================
--- ofbiz/trunk/applications/manufacturing/webapp/manufacturing/WEB-INF/actions/jobshopmgt/WorkWithShipmentPlans.groovy (original)
+++ ofbiz/trunk/applications/manufacturing/webapp/manufacturing/WEB-INF/actions/jobshopmgt/WorkWithShipmentPlans.groovy Sat May 12 21:19:10 2012
@@ -120,7 +120,7 @@ if (shipmentPlans) {
}
oneRow.weight = weight;
if (product.weightUomId) {
- weightUom = delegator.findByPrimaryKeyCache("Uom", [uomId : product.weightUomId]);
+ weightUom = delegator.findOne("Uom", [uomId : product.weightUomId], true);
oneRow.weightUom = weightUom.abbreviation;
}
volume = 0.0;
@@ -138,9 +138,9 @@ if (shipmentPlans) {
product.widthUomId &&
product.depthUomId) {
- heightUom = delegator.findByPrimaryKeyCache("Uom", [uomId : product.heightUomId]);
- widthUom = delegator.findByPrimaryKeyCache("Uom", [uomId : product.widthUomId]);
- depthUom = delegator.findByPrimaryKeyCache("Uom", [uomId : product.depthUomId]);
+ heightUom = delegator.findOne("Uom", [uomId : product.heightUomId], true);
+ widthUom = delegator.findOne("Uom", [uomId : product.widthUomId], true);
+ depthUom = delegator.findOne("Uom", [uomId : product.depthUomId], true);
oneRow.volumeUom = heightUom.abbreviation + "x" +
widthUom.abbreviation + "x" +
depthUom.abbreviation;
Modified: ofbiz/trunk/applications/manufacturing/webapp/manufacturing/WEB-INF/actions/reports/PRunsComponentsByFeature.groovy
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/manufacturing/webapp/manufacturing/WEB-INF/actions/reports/PRunsComponentsByFeature.groovy?rev=1337668&r1=1337667&r2=1337668&view=diff
==============================================================================
--- ofbiz/trunk/applications/manufacturing/webapp/manufacturing/WEB-INF/actions/reports/PRunsComponentsByFeature.groovy (original)
+++ ofbiz/trunk/applications/manufacturing/webapp/manufacturing/WEB-INF/actions/reports/PRunsComponentsByFeature.groovy Sat May 12 21:19:10 2012
@@ -24,11 +24,11 @@ import org.ofbiz.entity.util.EntityUtil;
import org.ofbiz.product.category.CategoryWorker;
if (productCategoryIdPar) {
- category = delegator.findByPrimaryKey("ProductCategory", [productCategoryId : productCategoryIdPar]);
+ category = delegator.findOne("ProductCategory", [productCategoryId : productCategoryIdPar], false);
context.category = category;
}
if (productFeatureTypeIdPar) {
- featureType = delegator.findByPrimaryKey("ProductFeatureType", [productFeatureTypeId : productFeatureTypeIdPar]);
+ featureType = delegator.findOne("ProductFeatureType", [productFeatureTypeId : productFeatureTypeIdPar], false);
context.featureType = featureType;
}
@@ -60,7 +60,7 @@ if (allProductionRuns) {
continue;
}
}
- productionRunProduct = delegator.findByPrimaryKey("Product", [productId : productionRunComponent.productId]);
+ productionRunProduct = delegator.findOne("Product", [productId : productionRunComponent.productId], false);
location = null;
if (productionRunProduct) {
Modified: ofbiz/trunk/applications/manufacturing/webapp/manufacturing/WEB-INF/actions/reports/PRunsInfoAndOrder.groovy
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/manufacturing/webapp/manufacturing/WEB-INF/actions/reports/PRunsInfoAndOrder.groovy?rev=1337668&r1=1337667&r2=1337668&view=diff
==============================================================================
--- ofbiz/trunk/applications/manufacturing/webapp/manufacturing/WEB-INF/actions/reports/PRunsInfoAndOrder.groovy (original)
+++ ofbiz/trunk/applications/manufacturing/webapp/manufacturing/WEB-INF/actions/reports/PRunsInfoAndOrder.groovy Sat May 12 21:19:10 2012
@@ -25,7 +25,7 @@ import org.ofbiz.manufacturing.jobshopmg
import org.ofbiz.order.order.OrderReadHelper;
if (productCategoryIdPar) {
- category = delegator.findByPrimaryKey("ProductCategory", [productCategoryId : productCategoryIdPar]);
+ category = delegator.findOne("ProductCategory", [productCategoryId : productCategoryIdPar], false);
context.category = category;
}
@@ -41,7 +41,7 @@ if (allProductionRuns) {
continue;
}
}
- productionRunProduct = delegator.findByPrimaryKey("Product", [productId : productionRun.productId]);
+ productionRunProduct = delegator.findOne("Product", [productId : productionRun.productId], false);
String rootProductionRunId = ProductionRunHelper.getRootProductionRun(delegator, productionRun.workEffortId);
productionRunOrders = delegator.findByAnd("WorkOrderItemFulfillment", [workEffortId : rootProductionRunId]);
@@ -67,7 +67,7 @@ if (allProductionRuns) {
if (allProductionComponents) {
allProductionComponents.each { productionComponent ->
- productionRunProductComp = delegator.findByPrimaryKey("Product", [productId : productionComponent.productId]);
+ productionRunProductComp = delegator.findOne("Product", [productId : productionComponent.productId], false);
productionRunProductMap = [component : productionComponent,componentProduct : productionRunProductComp];
componentList.add(productionRunProductMap);
}
Modified: ofbiz/trunk/applications/manufacturing/webapp/manufacturing/WEB-INF/actions/reports/PRunsProductsAndOrder.groovy
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/manufacturing/webapp/manufacturing/WEB-INF/actions/reports/PRunsProductsAndOrder.groovy?rev=1337668&r1=1337667&r2=1337668&view=diff
==============================================================================
--- ofbiz/trunk/applications/manufacturing/webapp/manufacturing/WEB-INF/actions/reports/PRunsProductsAndOrder.groovy (original)
+++ ofbiz/trunk/applications/manufacturing/webapp/manufacturing/WEB-INF/actions/reports/PRunsProductsAndOrder.groovy Sat May 12 21:19:10 2012
@@ -25,7 +25,7 @@ import org.ofbiz.manufacturing.jobshopmg
import org.ofbiz.order.order.OrderReadHelper;
if (productCategoryIdPar) {
- category = delegator.findByPrimaryKey("ProductCategory", [productCategoryId : productCategoryIdPar]);
+ category = delegator.findOne("ProductCategory", [productCategoryId : productCategoryIdPar], false);
context.category = category;
}
@@ -41,7 +41,7 @@ if (allProductionRuns) {
continue;
}
}
- productionRunProduct = delegator.findByPrimaryKey("Product", [productId : productionRun.productId]);
+ productionRunProduct = delegator.findOne("Product", [productId : productionRun.productId], false);
String rootProductionRunId = ProductionRunHelper.getRootProductionRun(delegator, productionRun.workEffortId);
productionRunOrders = delegator.findByAnd("WorkOrderItemFulfillment", [workEffortId : rootProductionRunId]);
Modified: ofbiz/trunk/applications/manufacturing/webapp/manufacturing/WEB-INF/actions/reports/PRunsProductsByFeature.groovy
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/manufacturing/webapp/manufacturing/WEB-INF/actions/reports/PRunsProductsByFeature.groovy?rev=1337668&r1=1337667&r2=1337668&view=diff
==============================================================================
--- ofbiz/trunk/applications/manufacturing/webapp/manufacturing/WEB-INF/actions/reports/PRunsProductsByFeature.groovy (original)
+++ ofbiz/trunk/applications/manufacturing/webapp/manufacturing/WEB-INF/actions/reports/PRunsProductsByFeature.groovy Sat May 12 21:19:10 2012
@@ -23,11 +23,11 @@
import org.ofbiz.entity.util.EntityUtil;
if (productCategoryIdPar) {
- category = delegator.findByPrimaryKey("ProductCategory", [productCategoryId : productCategoryIdPar]);
+ category = delegator.findOne("ProductCategory", [productCategoryId : productCategoryIdPar], false);
context.category = category;
}
if (productFeatureTypeIdPar) {
- featureType = delegator.findByPrimaryKey("ProductFeatureType", [productFeatureTypeId : productFeatureTypeIdPar]);
+ featureType = delegator.findOne("ProductFeatureType", [productFeatureTypeId : productFeatureTypeIdPar], false);
context.featureType = featureType;
}
@@ -47,7 +47,7 @@ if (allProductionRuns) {
continue;
}
}
- productionRunProduct = delegator.findByPrimaryKey("Product", [productId : productionRun.productId]);
+ productionRunProduct = delegator.findOne("Product", [productId : productionRun.productId], false);
// group by standard feature of type productFeatureTypeIdPar
if (productFeatureTypeIdPar) {
Modified: ofbiz/trunk/applications/manufacturing/webapp/manufacturing/WEB-INF/actions/reports/PRunsProductsStacks.groovy
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/manufacturing/webapp/manufacturing/WEB-INF/actions/reports/PRunsProductsStacks.groovy?rev=1337668&r1=1337667&r2=1337668&view=diff
==============================================================================
--- ofbiz/trunk/applications/manufacturing/webapp/manufacturing/WEB-INF/actions/reports/PRunsProductsStacks.groovy (original)
+++ ofbiz/trunk/applications/manufacturing/webapp/manufacturing/WEB-INF/actions/reports/PRunsProductsStacks.groovy Sat May 12 21:19:10 2012
@@ -23,11 +23,11 @@
import org.ofbiz.entity.util.EntityUtil;
if (productCategoryIdPar) {
- category = delegator.findByPrimaryKey("ProductCategory", [productCategoryId : productCategoryIdPar]);
+ category = delegator.findOne("ProductCategory", [productCategoryId : productCategoryIdPar], false);
context.category = category;
}
if (productFeatureTypeIdPar) {
- featureType = delegator.findByPrimaryKey("ProductFeatureType", [productFeatureTypeId : productFeatureTypeIdPar]);
+ featureType = delegator.findOne("ProductFeatureType", [productFeatureTypeId : productFeatureTypeIdPar], false);
context.featureType = featureType;
}
@@ -45,7 +45,7 @@ if (allProductionRuns) {
continue;
}
}
- productionRunProduct = delegator.findByPrimaryKey("Product", [productId : productionRun.productId]);
+ productionRunProduct = delegator.findOne("Product", [productId : productionRun.productId], false);
location = [:];
if (productionRunProduct) {
locations = delegator.findByAnd("ProductFacilityLocation", [facilityId : productionRun.facilityId, productId : productionRun.productId]);
Modified: ofbiz/trunk/applications/manufacturing/webapp/manufacturing/WEB-INF/actions/reports/PackageContentsAndOrder.groovy
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/manufacturing/webapp/manufacturing/WEB-INF/actions/reports/PackageContentsAndOrder.groovy?rev=1337668&r1=1337667&r2=1337668&view=diff
==============================================================================
--- ofbiz/trunk/applications/manufacturing/webapp/manufacturing/WEB-INF/actions/reports/PackageContentsAndOrder.groovy (original)
+++ ofbiz/trunk/applications/manufacturing/webapp/manufacturing/WEB-INF/actions/reports/PackageContentsAndOrder.groovy Sat May 12 21:19:10 2012
@@ -25,11 +25,11 @@ import org.ofbiz.order.order.OrderReadHe
import org.ofbiz.order.order.OrderContentWrapper;
if (productCategoryIdPar) {
- category = delegator.findByPrimaryKey("ProductCategory", [productCategoryId : productCategoryIdPar]);
+ category = delegator.findOne("ProductCategory", [productCategoryId : productCategoryIdPar], false);
context.category = category;
}
if (productFeatureTypeIdPar) {
- featureType = delegator.findByPrimaryKey("ProductFeatureType", [productFeatureTypeId : productFeatureTypeIdPar]);
+ featureType = delegator.findOne("ProductFeatureType", [productFeatureTypeId : productFeatureTypeIdPar], false);
context.featureType = featureType;
}
packageContents = delegator.findByAnd("ShipmentPackageContent", [shipmentId : shipmentId]);
@@ -39,7 +39,7 @@ if (packageContents) {
packageContents.each { packageContent ->
orderShipments = delegator.findByAnd("OrderShipment", [shipmentId : shipmentId, shipmentItemSeqId : packageContent.shipmentItemSeqId]);
orderShipment = EntityUtil.getFirst(orderShipments);
- orderItem = delegator.findByPrimaryKey("OrderItem", [orderId : orderShipment.orderId, orderItemSeqId : orderShipment.orderItemSeqId]);
+ orderItem = delegator.findOne("OrderItem", [orderId : orderShipment.orderId, orderItemSeqId : orderShipment.orderItemSeqId], false);
product = orderItem.getRelatedOne("Product");
// verify if the product is a member of the given category (based on the report's parameter)
if (productCategoryIdPar) {
Modified: ofbiz/trunk/applications/manufacturing/webapp/manufacturing/WEB-INF/actions/reports/ShipmentLabel.groovy
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/manufacturing/webapp/manufacturing/WEB-INF/actions/reports/ShipmentLabel.groovy?rev=1337668&r1=1337667&r2=1337668&view=diff
==============================================================================
--- ofbiz/trunk/applications/manufacturing/webapp/manufacturing/WEB-INF/actions/reports/ShipmentLabel.groovy (original)
+++ ofbiz/trunk/applications/manufacturing/webapp/manufacturing/WEB-INF/actions/reports/ShipmentLabel.groovy Sat May 12 21:19:10 2012
@@ -21,7 +21,7 @@ import org.ofbiz.entity.util.EntityUtil;
import org.ofbiz.order.order.OrderReadHelper;
shipmentId = parameters.shipmentId;
-shipment = delegator.findByPrimaryKey("Shipment", [shipmentId : shipmentId]);
+shipment = delegator.findOne("Shipment", [shipmentId : shipmentId], false);
context.shipmentIdPar = shipment.shipmentId;
@@ -54,7 +54,7 @@ if (shipment) {
record.shipmentPackageSeqId = shipmentPackageComponent.shipmentPackageSeqId;
record.orderId = orderId;
record.orderItemSeqId = orderItemSeqId;
- product = delegator.findByPrimaryKey("Product", [productId : record.productId]);
+ product = delegator.findOne("Product", [productId : record.productId], false);
record.productName = product.internalName;
record.shipDate = shipment.estimatedShipDate;
// ---
@@ -62,7 +62,7 @@ if (shipment) {
if (orderReaders.containsKey(orderId)) {
orderReadHelper = (OrderReadHelper)orderReaders.get(orderId);
} else {
- orderHeader = delegator.findByPrimaryKey("OrderHeader", [orderId : orderId]);
+ orderHeader = delegator.findOne("OrderHeader", [orderId : orderId], false);
orderReadHelper = new OrderReadHelper(orderHeader);
orderReaders.put(orderId, orderReadHelper);
}
Modified: ofbiz/trunk/applications/manufacturing/webapp/manufacturing/WEB-INF/actions/reports/ShipmentPlanStockReport.groovy
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/manufacturing/webapp/manufacturing/WEB-INF/actions/reports/ShipmentPlanStockReport.groovy?rev=1337668&r1=1337667&r2=1337668&view=diff
==============================================================================
--- ofbiz/trunk/applications/manufacturing/webapp/manufacturing/WEB-INF/actions/reports/ShipmentPlanStockReport.groovy (original)
+++ ofbiz/trunk/applications/manufacturing/webapp/manufacturing/WEB-INF/actions/reports/ShipmentPlanStockReport.groovy Sat May 12 21:19:10 2012
@@ -22,7 +22,7 @@ import org.ofbiz.base.util.*;
inventoryStock = [:];
shipmentId = parameters.shipmentId;
-shipment = delegator.findByPrimaryKey("Shipment", [shipmentId : shipmentId]);
+shipment = delegator.findOne("Shipment", [shipmentId : shipmentId], false);
context.shipmentIdPar = shipment.shipmentId;
context.estimatedReadyDatePar = shipment.estimatedReadyDate;
@@ -31,7 +31,7 @@ records = [];
if (shipment) {
shipmentPlans = delegator.findByAnd("OrderShipment", [shipmentId : shipmentId]);
shipmentPlans.each { shipmentPlan ->
- orderLine = delegator.findByPrimaryKey("OrderItem", [orderId : shipmentPlan.orderId , orderItemSeqId : shipmentPlan.orderItemSeqId]);
+ orderLine = delegator.findOne("OrderItem", [orderId : shipmentPlan.orderId , orderItemSeqId : shipmentPlan.orderItemSeqId], false);
recordGroup = [:];
recordGroup.ORDER_ID = shipmentPlan.orderId;
recordGroup.ORDER_ITEM_SEQ_ID = shipmentPlan.orderItemSeqId;
@@ -40,7 +40,7 @@ if (shipment) {
recordGroup.PRODUCT_ID = orderLine.productId;
recordGroup.QUANTITY = shipmentPlan.quantity;
- product = delegator.findByPrimaryKey("Product", [productId : orderLine.productId]);
+ product = delegator.findOne("Product", [productId : orderLine.productId], false);
recordGroup.PRODUCT_NAME = product.internalName;
inputPar = [productId : orderLine.productId,
Modified: ofbiz/trunk/applications/manufacturing/webapp/manufacturing/WEB-INF/actions/reports/ShipmentWorkEffortTasks.groovy
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/manufacturing/webapp/manufacturing/WEB-INF/actions/reports/ShipmentWorkEffortTasks.groovy?rev=1337668&r1=1337667&r2=1337668&view=diff
==============================================================================
--- ofbiz/trunk/applications/manufacturing/webapp/manufacturing/WEB-INF/actions/reports/ShipmentWorkEffortTasks.groovy (original)
+++ ofbiz/trunk/applications/manufacturing/webapp/manufacturing/WEB-INF/actions/reports/ShipmentWorkEffortTasks.groovy Sat May 12 21:19:10 2012
@@ -20,7 +20,7 @@
import org.ofbiz.entity.GenericValue;
shipmentId = parameters.shipmentId;
-shipment = delegator.findByPrimaryKey("Shipment", [shipmentId : shipmentId]);
+shipment = delegator.findOne("Shipment", [shipmentId : shipmentId], false);
context.shipmentIdPar = shipment.shipmentId;
context.date = new Date();
Modified: ofbiz/trunk/applications/manufacturing/webapp/manufacturing/WEB-INF/actions/routing/EditCalendar.groovy
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/manufacturing/webapp/manufacturing/WEB-INF/actions/routing/EditCalendar.groovy?rev=1337668&r1=1337667&r2=1337668&view=diff
==============================================================================
--- ofbiz/trunk/applications/manufacturing/webapp/manufacturing/WEB-INF/actions/routing/EditCalendar.groovy (original)
+++ ofbiz/trunk/applications/manufacturing/webapp/manufacturing/WEB-INF/actions/routing/EditCalendar.groovy Sat May 12 21:19:10 2012
@@ -22,7 +22,7 @@ import org.ofbiz.base.util.UtilHttp;
requestParams = UtilHttp.getParameterMap(request);
calendarId = requestParams.get("calendarId") ?: request.getAttribute("calendarId");
if (calendarId != null) {
- techDataCalendar = delegator.findByPrimaryKey("TechDataCalendar", [calendarId : calendarId]);
+ techDataCalendar = delegator.findOne("TechDataCalendar", [calendarId : calendarId], false);
context.techDataCalendar = techDataCalendar;
}
Modified: ofbiz/trunk/applications/manufacturing/webapp/manufacturing/WEB-INF/actions/routing/EditCalendarExceptionDay.groovy
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/manufacturing/webapp/manufacturing/WEB-INF/actions/routing/EditCalendarExceptionDay.groovy?rev=1337668&r1=1337667&r2=1337668&view=diff
==============================================================================
--- ofbiz/trunk/applications/manufacturing/webapp/manufacturing/WEB-INF/actions/routing/EditCalendarExceptionDay.groovy (original)
+++ ofbiz/trunk/applications/manufacturing/webapp/manufacturing/WEB-INF/actions/routing/EditCalendarExceptionDay.groovy Sat May 12 21:19:10 2012
@@ -33,7 +33,7 @@ calendarExceptionDays = [];
calendarId = parameters.calendarId ?: request.getAttribute("calendarId");
if (calendarId) {
- techDataCalendar = delegator.findByPrimaryKey("TechDataCalendar", [calendarId : calendarId]);
+ techDataCalendar = delegator.findOne("TechDataCalendar", [calendarId : calendarId], false);
}
if (techDataCalendar) {
calendarExceptionDays = techDataCalendar.getRelated("TechDataCalendarExcDay");
@@ -52,7 +52,7 @@ exceptionDateStartTime = parameters.exce
exceptionDateStartTime = ObjectType.simpleTypeConvert(exceptionDateStartTime, "Timestamp", null, null);
if (exceptionDateStartTime) {
- calendarExceptionDay = delegator.findByPrimaryKey("TechDataCalendarExcDay", [calendarId : calendarId , exceptionDateStartTime : exceptionDateStartTime]);
+ calendarExceptionDay = delegator.findOne("TechDataCalendarExcDay", [calendarId : calendarId , exceptionDateStartTime : exceptionDateStartTime], false);
if (calendarExceptionDay) {
HtmlFormWrapper updateCalendarExceptionDayWrapper = new HtmlFormWrapper("component://manufacturing/widget/manufacturing/CalendarForms.xml", "UpdateCalendarExceptionDay", request, response);
updateCalendarExceptionDayWrapper.putInContext("calendarExceptionDay", calendarExceptionDay);
Modified: ofbiz/trunk/applications/manufacturing/webapp/manufacturing/WEB-INF/actions/routing/EditCalendarExceptionWeek.groovy
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/manufacturing/webapp/manufacturing/WEB-INF/actions/routing/EditCalendarExceptionWeek.groovy?rev=1337668&r1=1337667&r2=1337668&view=diff
==============================================================================
--- ofbiz/trunk/applications/manufacturing/webapp/manufacturing/WEB-INF/actions/routing/EditCalendarExceptionWeek.groovy (original)
+++ ofbiz/trunk/applications/manufacturing/webapp/manufacturing/WEB-INF/actions/routing/EditCalendarExceptionWeek.groovy Sat May 12 21:19:10 2012
@@ -31,7 +31,7 @@ calendarExceptionWeeks = [];
calendarId = parameters.calendarId ?: request.getAttribute("calendarId");;
if (calendarId) {
- techDataCalendar = delegator.findByPrimaryKey("TechDataCalendar", [calendarId : calendarId]);
+ techDataCalendar = delegator.findOne("TechDataCalendar", [calendarId : calendarId], false);
}
if (techDataCalendar) {
calendarExceptionWeeks = techDataCalendar.getRelated("TechDataCalendarExcWeek");
@@ -56,7 +56,7 @@ exceptionDateStart = parameters.exceptio
exceptionDateStart = ObjectType.simpleTypeConvert(exceptionDateStart, "java.sql.Date", null, null);
if (exceptionDateStart) {
- calendarExceptionWeek = delegator.findByPrimaryKey("TechDataCalendarExcWeek", [calendarId : calendarId , exceptionDateStart : exceptionDateStart]);
+ calendarExceptionWeek = delegator.findOne("TechDataCalendarExcWeek", [calendarId : calendarId , exceptionDateStart : exceptionDateStart], false);
if (calendarExceptionWeek) {
HtmlFormWrapper updateCalendarExceptionWeekWrapper = new HtmlFormWrapper("component://manufacturing/widget/manufacturing/CalendarForms.xml", "UpdateCalendarExceptionWeek", request, response);
updateCalendarExceptionWeekWrapper.putInContext("calendarExceptionWeek", calendarExceptionWeek);
Modified: ofbiz/trunk/applications/manufacturing/webapp/manufacturing/bom/EditProductBom.ftl
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/manufacturing/webapp/manufacturing/bom/EditProductBom.ftl?rev=1337668&r1=1337667&r2=1337668&view=diff
==============================================================================
--- ofbiz/trunk/applications/manufacturing/webapp/manufacturing/bom/EditProductBom.ftl (original)
+++ ofbiz/trunk/applications/manufacturing/webapp/manufacturing/bom/EditProductBom.ftl Sat May 12 21:19:10 2012
@@ -49,7 +49,7 @@ function lookupBom() {
<td>
<select name="productAssocTypeId" size="1">
<#if productAssocTypeId?has_content>
- <#assign curAssocType = delegator.findByPrimaryKey("ProductAssocType", Static["org.ofbiz.base.util.UtilMisc"].toMap("productAssocTypeId", productAssocTypeId))>
+ <#assign curAssocType = delegator.findOne("ProductAssocType", Static["org.ofbiz.base.util.UtilMisc"].toMap("productAssocTypeId", productAssocTypeId), false)>
<#if curAssocType?exists>
<option selected="selected" value="${(curAssocType.productAssocTypeId)?if_exists}">${(curAssocType.get("description",locale))?if_exists}</option>
<option value="${(curAssocType.productAssocTypeId)?if_exists}"></option>
@@ -91,7 +91,7 @@ function lookupBom() {
<td>
<select name="productAssocTypeId" size="1">
<#if productAssocTypeId?has_content>
- <#assign curAssocType = delegator.findByPrimaryKey("ProductAssocType", Static["org.ofbiz.base.util.UtilMisc"].toMap("productAssocTypeId", productAssocTypeId))>
+ <#assign curAssocType = delegator.findOne("ProductAssocType", Static["org.ofbiz.base.util.UtilMisc"].toMap("productAssocTypeId", productAssocTypeId), false)>
<#if curAssocType?exists>
<option selected="selected" value="${(curAssocType.productAssocTypeId)?if_exists}">${(curAssocType.get("description",locale))?if_exists}</option>
<option value="${(curAssocType.productAssocTypeId)?if_exists}"></option>
Modified: ofbiz/trunk/applications/manufacturing/webapp/manufacturing/jobshopmgt/ShowProductionRun.groovy
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/manufacturing/webapp/manufacturing/jobshopmgt/ShowProductionRun.groovy?rev=1337668&r1=1337667&r2=1337668&view=diff
==============================================================================
--- ofbiz/trunk/applications/manufacturing/webapp/manufacturing/jobshopmgt/ShowProductionRun.groovy (original)
+++ ofbiz/trunk/applications/manufacturing/webapp/manufacturing/jobshopmgt/ShowProductionRun.groovy Sat May 12 21:19:10 2012
@@ -36,11 +36,11 @@ if (UtilValidate.isEmpty(productionRunId
}
if (UtilValidate.isNotEmpty(productionRunId)) {
- GenericValue productionRun = delegator.findByPrimaryKey("WorkEffort", UtilMisc.toMap("workEffortId", productionRunId));
+ GenericValue productionRun = delegator.findOne("WorkEffort", UtilMisc.toMap("workEffortId", productionRunId), false);
if (UtilValidate.isNotEmpty(productionRun)) {
// If this is a task, get the parent production run
if (productionRun.getString("workEffortTypeId") != null && "PROD_ORDER_TASK".equals(productionRun.getString("workEffortTypeId"))) {
- productionRun = delegator.findByPrimaryKey("WorkEffort", UtilMisc.toMap("workEffortId", productionRun.getString("workEffortParentId")));
+ productionRun = delegator.findOne("WorkEffort", UtilMisc.toMap("workEffortId", productionRun.getString("workEffortParentId")), false);
}
}
Modified: ofbiz/trunk/applications/manufacturing/webapp/manufacturing/mrp/findInventoryEventPlan.ftl
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/manufacturing/webapp/manufacturing/mrp/findInventoryEventPlan.ftl?rev=1337668&r1=1337667&r2=1337668&view=diff
==============================================================================
--- ofbiz/trunk/applications/manufacturing/webapp/manufacturing/mrp/findInventoryEventPlan.ftl (original)
+++ ofbiz/trunk/applications/manufacturing/webapp/manufacturing/mrp/findInventoryEventPlan.ftl Sat May 12 21:19:10 2012
@@ -166,7 +166,7 @@ document.lookupinventory.productId.focus
<#assign quantityAvailableAtDate = initialQohEvent.quantity>
</#if>
<#if initialQohEvent.facilityId?has_content>
- <#assign productFacility = delegator.findByPrimaryKey("ProductFacility", Static["org.ofbiz.base.util.UtilMisc"].toMap("facilityId", initialQohEvent.facilityId, "productId", inven.productId))?if_exists>
+ <#assign productFacility = delegator.findOne("ProductFacility", Static["org.ofbiz.base.util.UtilMisc"].toMap("facilityId", initialQohEvent.facilityId, "productId", inven.productId), false)?if_exists>
</#if>
<#else>
<#assign additionalErrorMessage = "No QOH information found, assuming 0.">