Author: ashish
Date: Sat Nov 15 07:07:36 2014 New Revision: 1639841 URL: http://svn.apache.org/r1639841 Log: 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/trunk/applications/order/webapp/ordermgr/WEB-INF/actions/entry/catalog/ProductSummary.groovy ofbiz/trunk/applications/product/config/ProductUiLabels.xml ofbiz/trunk/applications/product/script/org/ofbiz/product/store/ProductStoreServices.xml Modified: ofbiz/trunk/applications/order/webapp/ordermgr/WEB-INF/actions/entry/catalog/ProductSummary.groovy URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/order/webapp/ordermgr/WEB-INF/actions/entry/catalog/ProductSummary.groovy?rev=1639841&r1=1639840&r2=1639841&view=diff ============================================================================== --- ofbiz/trunk/applications/order/webapp/ordermgr/WEB-INF/actions/entry/catalog/ProductSummary.groovy (original) +++ ofbiz/trunk/applications/order/webapp/ordermgr/WEB-INF/actions/entry/catalog/ProductSummary.groovy Sat Nov 15 07:07:36 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/trunk/applications/product/config/ProductUiLabels.xml URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/product/config/ProductUiLabels.xml?rev=1639841&r1=1639840&r2=1639841&view=diff ============================================================================== --- ofbiz/trunk/applications/product/config/ProductUiLabels.xml (original) +++ ofbiz/trunk/applications/product/config/ProductUiLabels.xml Sat Nov 15 07:07:36 2014 @@ -8360,6 +8360,9 @@ <value xml:lang="zh">欢è¿ä½¿ç¨å¾ç管ç</value> <value xml:lang="zh_TW">æ¡è¿ä½¿ç¨åç管ç</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/trunk/applications/product/script/org/ofbiz/product/store/ProductStoreServices.xml URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/product/script/org/ofbiz/product/store/ProductStoreServices.xml?rev=1639841&r1=1639840&r2=1639841&view=diff ============================================================================== --- ofbiz/trunk/applications/product/script/org/ofbiz/product/store/ProductStoreServices.xml (original) +++ ofbiz/trunk/applications/product/script/org/ofbiz/product/store/ProductStoreServices.xml Sat Nov 15 07:07:36 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 |