Author: sichen
Date: Fri Sep 29 17:07:31 2006
New Revision: 451497
URL:
http://svn.apache.org/viewvc?view=rev&rev=451497Log:
Fix supplier product add/update form so that it does not make you think you can change the supplier party and available from date when updating a supplier product, since those fields are primary keys
Modified:
incubator/ofbiz/trunk/applications/product/webapp/catalog/product/ProductForms.xml
Modified: incubator/ofbiz/trunk/applications/product/webapp/catalog/product/ProductForms.xml
URL:
http://svn.apache.org/viewvc/incubator/ofbiz/trunk/applications/product/webapp/catalog/product/ProductForms.xml?view=diff&rev=451497&r1=451496&r2=451497==============================================================================
--- incubator/ofbiz/trunk/applications/product/webapp/catalog/product/ProductForms.xml (original)
+++ incubator/ofbiz/trunk/applications/product/webapp/catalog/product/ProductForms.xml Fri Sep 29 17:07:31 2006
@@ -536,8 +536,10 @@
default-title-style="tableheadtext" default-widget-style="inputBox" default-tooltip-style="tabletext">
<alt-target use-when="supplierProduct==null" target="createSupplierProduct"/>
<auto-fields-service service-name="updateSupplierProduct" map-name=""/>
+ <!-- productId, partyId, and availableFromDate are primary keys of SupplierProduct and should not be updatable, so we use use-when to change the behavior of the form
+ if there is a SupplierProduct value available. productId is always hidden (assuming it exists) so this is not an issue -->
<field name="productId"><hidden value="${productId}"/></field>
- <field name="partyId" title="${uiLabelMap.ProductSupplier}">
+ <field name="partyId" title="${uiLabelMap.ProductSupplier}" use-when="supplierProduct==null">
<drop-down allow-empty="false">
<entity-options entity-name="PartyRoleAndPartyDetail" description="${groupName} ${firstName} ${lastName} [${partyId}]">
<entity-constraint name="roleTypeId" value="SUPPLIER"/>
@@ -559,6 +561,15 @@
<entity-order-by field-name="description"/>
</entity-options>
</drop-down>
+ </field>
+ <field name="partyId" title="${uiLabelMap.ProductSupplier}" use-when="supplierProduct!=null" widget-style="tabletext">
+ <display-entity entity-name="PartyNameView" description="${firstName} ${middleName} ${lastName} ${groupName}"/>
+ </field>
+ <field name="availableFromDate" use-when="supplierProduct==null">
+ <date-time/>
+ </field>
+ <field name="availableFromDate" use-when="supplierProduct!=null" widget-style="tabletext">
+ <display/>
</field>
<field name="quantityUomId" title="${uiLabelMap.ProductQuantityUomId}">
<drop-down allow-empty="true">