You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ofbiz.apache.org by jl...@apache.org on 2016/10/21 17:22:29 UTC

svn commit: r1766074 - /ofbiz/trunk/applications/product/widget/catalog/ProductForms.xml

Author: jleroux
Date: Fri Oct 21 17:22:29 2016
New Revision: 1766074

URL: http://svn.apache.org/viewvc?rev=1766074&view=rev
Log:
Fixed: product page missing form elements
(OFBIZ-8489)

At r1746422, Deepak added a condition on EditProduct form. InventoryItemTypeId 
was enabled only for Product creation, else displayed as readonly, instead of 
editable dropdown

The only problem is that you can have the inventoryItemTypeId with a null value.
It's then considered by convention as not serialised. But then only the label 
shows. I fix it at by setting the inventoryItemTypeId as not serialised in this 
case. It was a bit tricky because you have to consider if the product is null 
(creation) and then not set product.inventoryItemTypeId. It would else defeat 
the creation case and give other contradictions.

Thanks: Wai for report

Modified:
    ofbiz/trunk/applications/product/widget/catalog/ProductForms.xml

Modified: ofbiz/trunk/applications/product/widget/catalog/ProductForms.xml
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/product/widget/catalog/ProductForms.xml?rev=1766074&r1=1766073&r2=1766074&view=diff
==============================================================================
--- ofbiz/trunk/applications/product/widget/catalog/ProductForms.xml (original)
+++ ofbiz/trunk/applications/product/widget/catalog/ProductForms.xml Fri Oct 21 17:22:29 2016
@@ -57,6 +57,10 @@ under the License.
 
     <form name="EditProduct" type="single" target="updateProduct" title="" default-map-name="product"
         header-row-style="header-row" default-table-style="basic-table">
+        
+        <actions>
+            <set field="dummy" value="${groovy: if(product) product?.inventoryItemTypeId = product?.inventoryItemTypeId ?: 'NON_SERIAL_INV_ITEM'}"/>
+        </actions>
 
         <alt-target use-when="product==null" target="createProduct"/>
 
@@ -131,7 +135,7 @@ under the License.
             </drop-down>
         </field>
         <field name="inventoryItemTypeId" title="${uiLabelMap.ProductInventoryItemTypeId}" use-when="product!=null">
-            <display-entity entity-name="InventoryItemType"/>
+            <display-entity entity-name="InventoryItemType" />
         </field>
 
         <field name="lotIdFilledIn" title="${uiLabelMap.ProductLotId}">