You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ofbiz.apache.org by si...@apache.org on 2006/12/06 00:01:16 UTC

svn commit: r482820 - /incubator/ofbiz/trunk/applications/order/script/org/ofbiz/order/request/CustRequestServices.xml

Author: sichen
Date: Tue Dec  5 15:01:15 2006
New Revision: 482820

URL: http://svn.apache.org/viewvc?view=rev&rev=482820
Log:
createCustRequest will now check that userLogin actually has a partyId, in case it is called by system user.  It may still be nice to assign a party to the system user, but null checking is never bad in my opinion, so I'm going to put this in as well

Modified:
    incubator/ofbiz/trunk/applications/order/script/org/ofbiz/order/request/CustRequestServices.xml

Modified: incubator/ofbiz/trunk/applications/order/script/org/ofbiz/order/request/CustRequestServices.xml
URL: http://svn.apache.org/viewvc/incubator/ofbiz/trunk/applications/order/script/org/ofbiz/order/request/CustRequestServices.xml?view=diff&rev=482820&r1=482819&r2=482820
==============================================================================
--- incubator/ofbiz/trunk/applications/order/script/org/ofbiz/order/request/CustRequestServices.xml (original)
+++ incubator/ofbiz/trunk/applications/order/script/org/ofbiz/order/request/CustRequestServices.xml Tue Dec  5 15:01:15 2006
@@ -55,12 +55,14 @@
              then we associate it to the request as the request taker.
              This is not done if they are the same e.g. a logged in customer that is creating a request for its
              own sake. -->
-        <if-compare-field field-name="parameters.fromPartyId" operator="not-equals" to-field-name="userLogin.partyId">
-            <set from-field="newEntity.custRequestId" field="takerMap.custRequestId"/>
-            <set from-field="userLogin.partyId" field="takerMap.partyId"/>
-            <set value="REQ_TAKER" field="takerMap.roleTypeId"/>
-            <call-service service-name="createCustRequestRole" in-map-name="takerMap"/>
-        </if-compare-field>
+        <if-not-empty field-name="userLogin.partyId">  <!-- just in case the service is called by the "system" userLogin -->
+            <if-compare-field field-name="parameters.fromPartyId" operator="not-equals" to-field-name="userLogin.partyId">
+                <set from-field="newEntity.custRequestId" field="takerMap.custRequestId"/>
+                <set from-field="userLogin.partyId" field="takerMap.partyId"/>
+                <set value="REQ_TAKER" field="takerMap.roleTypeId"/>
+                <call-service service-name="createCustRequestRole" in-map-name="takerMap"/>
+            </if-compare-field>
+        </if-not-empty>
         
         <!-- save the created status in the history -->
         <set-service-fields to-map-name="statusMap" service-name="createCustRequestStatus" map-name="newEntity"/>