Author: ashish Date: Sat Feb 21 12:26:28 2015 New Revision: 1661339 URL: http://svn.apache.org/r1661339 Log: Applied patch from jira issue - OFBIZ-6058 - Find Shipment generates an error. Thanks Pierre for reporting the issue, thanks Amardeep for providing the patch.
Modified: ofbiz/trunk/applications/product/webapp/facility/WEB-INF/actions/shipment/FindShipment.groovy Modified: ofbiz/trunk/applications/product/webapp/facility/WEB-INF/actions/shipment/FindShipment.groovy URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/product/webapp/facility/WEB-INF/actions/shipment/FindShipment.groovy?rev=1661339&r1=1661338&r2=1661339&view=diff ============================================================================== --- ofbiz/trunk/applications/product/webapp/facility/WEB-INF/actions/shipment/FindShipment.groovy (original) +++ ofbiz/trunk/applications/product/webapp/facility/WEB-INF/actions/shipment/FindShipment.groovy Sat Feb 21 12:26:28 2015 @@ -117,11 +117,6 @@ if (maxDate && maxDate.length() > 8) { if ("Y".equals(lookupFlag)) { context.paramList = paramListBuffer.toString(); - mainCond = null; - if (findShipmentExprs.size() > 0) { - mainCond = EntityCondition.makeCondition(findShipmentExprs, EntityOperator.AND); - } - beganTransaction = false; try { beganTransaction = TransactionUtil.begin(); @@ -132,7 +127,11 @@ if ("Y".equals(lookupFlag)) { if (!orderReturnValue) { // using list iterator - orli = from("Shipment").where(mainCond).orderBy("-estimatedShipDate").cursorScrollInsensitive().distinct().maxRows(highIndex).queryIterator(); + if (findShipmentExprs.size() > 0) { + orli = from("Shipment").where(EntityCondition.makeCondition(findShipmentExprs, EntityOperator.AND)).orderBy("-estimatedShipDate").cursorScrollInsensitive().distinct().maxRows(highIndex).queryIterator(); + } else { + orli = from("Shipment").orderBy("-estimatedShipDate").cursorScrollInsensitive().distinct().maxRows(highIndex).queryIterator(); + } shipmentListSize = orli.getResultsSizeAfterPartialList(); if (highIndex > shipmentListSize) {