Author: jleroux
Date: Sat Nov 15 21:22:11 2014 New Revision: 1639921 URL: http://svn.apache.org/r1639921 Log: "Applied fix from trunk for revision: 1639841" ------------------------------------------------------------------------ r1639841 | ashish | 2014-11-15 08:07:36 +0100 (sam. 15 nov. 2014) | 2 lignes Applied patch from jira issue - OFBIZ-904 - Error when "Inventory Facility Id" is left blank in product store settings. Thanks Michel for creating the issue and Thanks Arun Arun for providing the patch. ------------------------------------------------------------------------ Modified: ofbiz/branches/release13.07/ (props changed) ofbiz/branches/release13.07/applications/order/webapp/ordermgr/WEB-INF/actions/entry/catalog/ProductSummary.groovy ofbiz/branches/release13.07/applications/product/config/ProductUiLabels.xml ofbiz/branches/release13.07/applications/product/script/org/ofbiz/product/store/ProductStoreServices.xml Propchange: ofbiz/branches/release13.07/ ------------------------------------------------------------------------------ Merged /ofbiz/trunk:r1639841 Modified: ofbiz/branches/release13.07/applications/order/webapp/ordermgr/WEB-INF/actions/entry/catalog/ProductSummary.groovy URL: http://svn.apache.org/viewvc/ofbiz/branches/release13.07/applications/order/webapp/ordermgr/WEB-INF/actions/entry/catalog/ProductSummary.groovy?rev=1639921&r1=1639920&r2=1639921&view=diff ============================================================================== --- ofbiz/branches/release13.07/applications/order/webapp/ordermgr/WEB-INF/actions/entry/catalog/ProductSummary.groovy (original) +++ ofbiz/branches/release13.07/applications/order/webapp/ordermgr/WEB-INF/actions/entry/catalog/ProductSummary.groovy Sat Nov 15 21:22:11 2014 @@ -24,6 +24,7 @@ import org.ofbiz.base.util.*; import org.ofbiz.entity.*; +import org.ofbiz.entity.condition.*; import org.ofbiz.entity.util.*; import org.ofbiz.service.*; import org.ofbiz.product.product.ProductContentWrapper; @@ -52,6 +53,14 @@ if (cart.isSalesOrder()) { context.productStoreId = productStoreId; facilityId = productStore.inventoryFacilityId; } + +if (!facilityId) { + productStoreFacility = EntityQuery.use(delegator).select("facilityId").from("ProductStoreFacility").where(UtilMisc.toList(EntityCondition.makeCondition("productStoreId", EntityOperator.EQUALS, productStoreId))).queryFirst(); + if (productStoreFacility) { + facilityId = productStoreFacility.facilityId; + } +} + autoUserLogin = session.getAttribute("autoUserLogin"); userLogin = session.getAttribute("userLogin"); Modified: ofbiz/branches/release13.07/applications/product/config/ProductUiLabels.xml URL: http://svn.apache.org/viewvc/ofbiz/branches/release13.07/applications/product/config/ProductUiLabels.xml?rev=1639921&r1=1639920&r2=1639921&view=diff ============================================================================== --- ofbiz/branches/release13.07/applications/product/config/ProductUiLabels.xml (original) +++ ofbiz/branches/release13.07/applications/product/config/ProductUiLabels.xml Sat Nov 15 21:22:11 2014 @@ -7967,6 +7967,9 @@ <value xml:lang="vi">Chà o mừng Äến vá»i ứng dụng hình ảnh</value> <value xml:lang="zh">欢è¿ä½¿ç¨å¾ç管ç</value> </property> + <property key="InventoryFacilityIdRequired"> + <value xml:lang="en">"Inventory Facility Id Required"</value> + </property> <property key="MetaDescription"> <value xml:lang="en">Meta Description</value> <value xml:lang="ja">ã¡ã¿è©³ç´°</value> Modified: ofbiz/branches/release13.07/applications/product/script/org/ofbiz/product/store/ProductStoreServices.xml URL: http://svn.apache.org/viewvc/ofbiz/branches/release13.07/applications/product/script/org/ofbiz/product/store/ProductStoreServices.xml?rev=1639921&r1=1639920&r2=1639921&view=diff ============================================================================== --- ofbiz/branches/release13.07/applications/product/script/org/ofbiz/product/store/ProductStoreServices.xml (original) +++ ofbiz/branches/release13.07/applications/product/script/org/ofbiz/product/store/ProductStoreServices.xml Sat Nov 15 21:22:11 2014 @@ -25,6 +25,15 @@ under the License. <fail-property resource="ProductUiLabels" property="ProductCatalogCreatePermissionError"/> </check-permission> <check-errors/> + + <if-compare field="parameters.oneInventoryFacility" operator="equals" value="Y"> + <if-empty field="parameters.inventoryFacilityId"> + <add-error> + <fail-property property="InventoryFacilityIdRequired" resource="ProductUiLabels"/> + </add-error> + </if-empty> + <check-errors/> + </if-compare> <if-compare field="parameters.showPricesWithVatTax" operator="equals" value="Y"> <if-empty field="parameters.vatTaxAuthGeoId"> @@ -65,6 +74,15 @@ under the License. <fail-property resource="ProductUiLabels" property="ProductCatalogUpdatePermissionError"/> </check-permission> <check-errors/> + + <if-compare field="parameters.oneInventoryFacility" operator="equals" value="Y"> + <if-empty field="parameters.inventoryFacilityId"> + <add-error> + <fail-property property="InventoryFacilityIdRequired" resource="ProductUiLabels"/> + </add-error> + </if-empty> + <check-errors/> + </if-compare> <set from-field="parameters.productStoreId" field="lookupPKMap.productStoreId"/> <find-by-primary-key entity-name="ProductStore" map="lookupPKMap" value-field="store"/> |
Free forum by Nabble | Edit this page |