Author: taher
Date: Wed Oct 28 15:32:34 2015
New Revision: 1711038

URL: http://svn.apache.org/viewvc?rev=1711038&view=rev
Log:
backport commit from OFBIZ-6703 to release 13.07

this fixes the lead creation bug in the createLead service identified in above 
JIRA

Modified:
    
ofbiz/branches/release13.07/applications/marketing/script/org/ofbiz/sfa/lead/LeadServices.xml

Modified: 
ofbiz/branches/release13.07/applications/marketing/script/org/ofbiz/sfa/lead/LeadServices.xml
URL: 
http://svn.apache.org/viewvc/ofbiz/branches/release13.07/applications/marketing/script/org/ofbiz/sfa/lead/LeadServices.xml?rev=1711038&r1=1711037&r2=1711038&view=diff
==============================================================================
--- 
ofbiz/branches/release13.07/applications/marketing/script/org/ofbiz/sfa/lead/LeadServices.xml
 (original)
+++ 
ofbiz/branches/release13.07/applications/marketing/script/org/ofbiz/sfa/lead/LeadServices.xml
 Wed Oct 28 15:32:34 2015
@@ -40,7 +40,17 @@
         <check-errors/>
         <set field="createPartyRoleCtx.partyId" 
from-field="userLogin.partyId"/>
         <set field="createPartyRoleCtx.roleTypeId" value="OWNER"/>
-        <call-service service-name="createPartyRole" 
in-map-name="createPartyRoleCtx"/>
+
+        <!-- PartyRole check start - if the user does not have OWNER roleType 
then add it -->
+        <entity-one entity-name="PartyRole" value-field="roleFound">
+            <field-map field-name="partyId" 
from-field="createPartyRoleCtx.partyId"/>
+            <field-map field-name="roleTypeId" 
from-field="createPartyRoleCtx.roleTypeId"/>
+        </entity-one>
+        <if-empty field="roleFound">
+            <call-service service-name="createPartyRole" 
in-map-name="createPartyRoleCtx"/>
+        </if-empty>
+        <!-- PartyRole check end -->
+
         <if>
             <condition>
                 <and>


Reply via email to