Author: mor
Date: Sun Feb  7 17:31:41 2010
New Revision: 907452

URL: http://svn.apache.org/viewvc?rev=907452&view=rev
Log:
For a shopping list item, updating its quantity to zero will not remove the 
item from the shopping list. The test case is also modified with respect to the 
changes in updateShoppingListItem service.

Modified:
    
ofbiz/trunk/applications/order/script/org/ofbiz/order/shoppinglist/ShoppingListServices.xml
    
ofbiz/trunk/applications/order/script/org/ofbiz/order/test/ShoppingListTests.xml

Modified: 
ofbiz/trunk/applications/order/script/org/ofbiz/order/shoppinglist/ShoppingListServices.xml
URL: 
http://svn.apache.org/viewvc/ofbiz/trunk/applications/order/script/org/ofbiz/order/shoppinglist/ShoppingListServices.xml?rev=907452&r1=907451&r2=907452&view=diff
==============================================================================
--- 
ofbiz/trunk/applications/order/script/org/ofbiz/order/shoppinglist/ShoppingListServices.xml
 (original)
+++ 
ofbiz/trunk/applications/order/script/org/ofbiz/order/shoppinglist/ShoppingListServices.xml
 Sun Feb  7 17:31:41 2010
@@ -163,17 +163,8 @@
 
         <entity-one entity-name="ShoppingList" value-field="shoppingList"/>
         <entity-one entity-name="ShoppingListItem" 
value-field="shoppingListItem"/>
-
-        <if-compare field="parameters.quantity" operator="equals" value="0" 
type="BigDecimal">
-          <!-- if we're setting quantity to 0.0 then remove the item -->
-            <set-service-fields service-name="removeShoppingListItem" 
map="parameters" to-map="removeParams"/>
-            <call-service service-name="removeShoppingListItem" 
in-map-name="removeParams"/>
-        <else>
-          <!-- otherwise, just update shopping list item in place -->
-            <set-nonpk-fields map="parameters" value-field="shoppingListItem"/>
-            <store-value value-field="shoppingListItem"/>
-        </else>
-        </if-compare>
+        <set-nonpk-fields map="parameters" value-field="shoppingListItem"/>
+        <store-value value-field="shoppingListItem"/>
 
         <if-compare-field field="shoppingList.partyId" 
to-field="userLogin.partyId" operator="not-equals">
             <now-timestamp field="shoppingList.lastAdminModified"/>

Modified: 
ofbiz/trunk/applications/order/script/org/ofbiz/order/test/ShoppingListTests.xml
URL: 
http://svn.apache.org/viewvc/ofbiz/trunk/applications/order/script/org/ofbiz/order/test/ShoppingListTests.xml?rev=907452&r1=907451&r2=907452&view=diff
==============================================================================
--- 
ofbiz/trunk/applications/order/script/org/ofbiz/order/test/ShoppingListTests.xml
 (original)
+++ 
ofbiz/trunk/applications/order/script/org/ofbiz/order/test/ShoppingListTests.xml
 Sun Feb  7 17:31:41 2010
@@ -140,7 +140,7 @@
             <field-map field-name="shoppingListItemSeqId" value="00003"/>
         </entity-one>
         <assert>
-            <if-empty field="shoppingListItem"/>
+            <not><if-empty field="shoppingListItem"/></not>
         </assert>
         <check-errors/>
     </simple-method>


Reply via email to