Author: jleroux
Date: Fri Oct 18 19:31:06 2013 New Revision: 1533602 URL: http://svn.apache.org/r1533602 Log: "Applied fix from trunk for revisions: 1524676 + 1524769" ------------------------------------------------------------------------ r1524769 | jleroux | 2013-09-19 17:20:17 +0200 (jeu. 19 sept. 2013) | 3 lignes A patch from Anahita Goljahani for "Overview of Bills of Material doesn't paginate" https://issues.apache.org/jira/browse/OFBIZ-5324 Just for seek of tidiness, I attached another patch that removes redundant code in FindProductBom.groovy, without changing its behavior. ------------------------------------------------------------------------ Modified: ofbiz/branches/release12.04/ (props changed) ofbiz/branches/release12.04/applications/manufacturing/webapp/manufacturing/WEB-INF/actions/bom/FindProductBom.groovy Propchange: ofbiz/branches/release12.04/ ------------------------------------------------------------------------------ Merged /ofbiz/trunk:r1524676,1524769 Modified: ofbiz/branches/release12.04/applications/manufacturing/webapp/manufacturing/WEB-INF/actions/bom/FindProductBom.groovy URL: http://svn.apache.org/viewvc/ofbiz/branches/release12.04/applications/manufacturing/webapp/manufacturing/WEB-INF/actions/bom/FindProductBom.groovy?rev=1533602&r1=1533601&r2=1533602&view=diff ============================================================================== --- ofbiz/branches/release12.04/applications/manufacturing/webapp/manufacturing/WEB-INF/actions/bom/FindProductBom.groovy (original) +++ ofbiz/branches/release12.04/applications/manufacturing/webapp/manufacturing/WEB-INF/actions/bom/FindProductBom.groovy Fri Oct 18 19:31:06 2013 @@ -17,42 +17,32 @@ * under the License. */ -import org.ofbiz.base.util.*; import org.ofbiz.entity.util.*; import org.ofbiz.entity.condition.*; -import javolution.util.FastList; -import javolution.util.FastSet; -import javolution.util.FastMap; -if (!parameters.productId && !parameters.productIdTo && !parameters.productAssocTypeId) { +fieldToSelect = ["productId", "internalName", "productAssocTypeId"] as Set; +orderBy = ["productId", "productAssocTypeId"]; + +condList = []; +if (parameters.productId) { + cond = EntityCondition.makeCondition("productId", EntityOperator.EQUALS, parameters.productId); + condList.add(cond); +} +if (parameters.productIdTo) { + cond = EntityCondition.makeCondition("productIdTo", EntityOperator.EQUALS, parameters.productIdTo); + condList.add(cond); +} +if (parameters.productAssocTypeId) { + cond = EntityCondition.makeCondition("productAssocTypeId", EntityOperator.EQUALS, parameters.productAssocTypeId); + condList.add(cond); +} else { cond = EntityCondition.makeCondition([EntityCondition.makeCondition("productAssocTypeId", EntityOperator.EQUALS, "ENGINEER_COMPONENT"), EntityCondition.makeCondition("productAssocTypeId", EntityOperator.EQUALS, "MANUF_COMPONENT") ], EntityOperator.OR); - findOpts = new EntityFindOptions(true, EntityFindOptions.TYPE_SCROLL_INSENSITIVE, EntityFindOptions.CONCUR_READ_ONLY, true); - fieldToSelect = UtilMisc.toSet("productId","internalName","productAssocTypeId"); - bomListIterator = delegator.find("ProductAndAssoc", cond, null, fieldToSelect, null, findOpts); -} else { - condList = []; - if (parameters.productId) { - cond = EntityCondition.makeCondition("productId", EntityOperator.EQUALS, parameters.productId); - condList.add(cond); - } - if (parameters.productIdTo) { - cond = EntityCondition.makeCondition("productIdTo", EntityOperator.EQUALS, parameters.productIdTo); - condList.add(cond); - } - if (parameters.productAssocTypeId) { - cond = EntityCondition.makeCondition("productAssocTypeId", EntityOperator.EQUALS, parameters.productAssocTypeId); - condList.add(cond); - } else { - cond = EntityCondition.makeCondition([EntityCondition.makeCondition("productAssocTypeId", EntityOperator.EQUALS, "ENGINEER_COMPONENT"), - EntityCondition.makeCondition("productAssocTypeId", EntityOperator.EQUALS, "MANUF_COMPONENT") - ], EntityOperator.OR); - condList.add(cond); - } - cond = EntityCondition.makeCondition(condList, EntityOperator.AND); - findOpts = new EntityFindOptions(true, EntityFindOptions.TYPE_SCROLL_INSENSITIVE, EntityFindOptions.CONCUR_READ_ONLY, true); - fieldToSelect = UtilMisc.toSet("productId","internalName","productAssocTypeId"); - bomListIterator = delegator.find("ProductAndAssoc", cond, null, fieldToSelect, null, findOpts); + condList.add(cond); } +cond = EntityCondition.makeCondition(condList, EntityOperator.AND); +findOpts = new EntityFindOptions(true, EntityFindOptions.TYPE_SCROLL_INSENSITIVE, EntityFindOptions.CONCUR_READ_ONLY, true); +bomListIterator = delegator.find("ProductAndAssoc", cond, null, fieldToSelect, orderBy, findOpts); + context.ListProductBom = bomListIterator; |
Free forum by Nabble | Edit this page |