Author: hansbak
Date: Tue Jun 23 02:19:48 2009
New Revision: 787518
URL: http://svn.apache.org/viewvc?rev=787518&view=rev
Log:
add standard the contact role to person and the account to partygroup so that
they appear in sfa and the contact/company relationship can be created more easy
Modified:
ofbiz/trunk/applications/party/src/org/ofbiz/party/party/PartyServices.java
Modified:
ofbiz/trunk/applications/party/src/org/ofbiz/party/party/PartyServices.java
URL:
http://svn.apache.org/viewvc/ofbiz/trunk/applications/party/src/org/ofbiz/party/party/PartyServices.java?rev=787518&r1=787517&r2=787518&view=diff
==============================================================================
--- ofbiz/trunk/applications/party/src/org/ofbiz/party/party/PartyServices.java
(original)
+++ ofbiz/trunk/applications/party/src/org/ofbiz/party/party/PartyServices.java
Tue Jun 23 02:19:48 2009
@@ -180,6 +180,10 @@
person = delegator.makeValue("Person", UtilMisc.toMap("partyId",
partyId));
person.setNonPKFields(context);
toBeStored.add(person);
+
+ // standard add the role of "contact"
+ GenericValue partyRole = delegator.makeValue("PartyRole",
UtilMisc.toMap("partyId", partyId, "roleTypeId", "CONTACT"));
+ toBeStored.add(partyRole);
try {
delegator.storeAll(toBeStored);
@@ -414,6 +418,12 @@
partyGroup = delegator.makeValue("PartyGroup",
UtilMisc.toMap("partyId", partyId));
partyGroup.setNonPKFields(context);
partyGroup.create();
+
+ // standard add the role of "Account"
+ GenericValue partyRole = delegator.makeValue("PartyRole",
UtilMisc.toMap("partyId", partyId, "roleTypeId", "ACCOUNT"));
+ partyRole.create();
+
+
} catch (GenericEntityException e) {
Debug.logWarning(e, module);
Map<String, String> messageMap = UtilMisc.toMap("errMessage",
e.getMessage());