Jigar Amin (OpenERP) has proposed merging
lp:~openerp-dev/openobject-addons/trunk-import_salesforce-b9_contact-jam into
lp:~openerp-dev/openobject-addons/trunk-import_salesforce.
Requested reviews:
Bhumika (OpenERP) (sbh-openerp)
For more details, see:
https://code.launchpad.net/~openerp-dev/openobject-addons/trunk-import_salesforce-b9_contact-jam/+merge/66992
Changes:
1) Salution goes to address title.
2) Title goes to function,
3) Account Name => Parent account and Account table in dependency.
4) Contact Owner => Salesman and User table in Dependency
5) In description - ppconcat (Description, Home phone, other phone, reports
to, Birthdate, Assistant, Assistant Phone, Languages, Lead source)
Kindly Review this
Thank You
--
https://code.launchpad.net/~openerp-dev/openobject-addons/trunk-import_salesforce-b9_contact-jam/+merge/66992
Your team OpenERP R&D Team is subscribed to branch
lp:~openerp-dev/openobject-addons/trunk-import_salesforce.
=== modified file 'import_salesforce/wizard/import_salesforce.py'
--- import_salesforce/wizard/import_salesforce.py 2011-07-05 04:58:26 +0000
+++ import_salesforce/wizard/import_salesforce.py 2011-07-06 06:34:50 +0000
@@ -71,7 +71,7 @@
self.TABLE_USER: "SELECT Id, Name, Username, Email, Street, City, State, Country, PostalCode, Phone, Fax, MobilePhone, TimeZoneSidKey, LanguageLocaleKey FROM %s"%(self.TABLE_USER),
self.TABLE_FOLDER: "SELECT Id, Name FROM %s WHERE Type = 'Document'"%(self.TABLE_FOLDER),
self.TABLE_DOCUMENT: "SELECT Id, Name, Type, AuthorId, FolderId, Description, Url FROM %s"%(self.TABLE_DOCUMENT),
- self.TABLE_CONTACT: "SELECT Id, Name, Title, Email, MailingStreet, MailingCity, Phone, MobilePhone, MailingPostalCode, MailingState, MailingCountry, Fax, OtherStreet, OtherCity, OtherCountry, OtherState, OtherPostalCode, OtherPhone FROM %s"%(self.TABLE_CONTACT),
+ self.TABLE_CONTACT: "SELECT Id, AccountId, OwnerId, Name, Title, Salutation, Email, MailingStreet, MailingCity, Phone, MobilePhone, MailingPostalCode, MailingState, MailingCountry, Fax, OtherStreet, OtherCity, OtherCountry, OtherState, OtherPostalCode, OtherPhone, HomePhone, ReportsTo.Name, Birthdate, AssistantName, AssistantPhone, Languages__c, LeadSource, Description FROM %s"%(self.TABLE_CONTACT),
self.TABLE_LEAD: "SELECT Id, Name, Title, Phone, Email, MobilePhone, Company, Description, PostalCode, Street, City, Rating, Country, Status, LeadSource, Salutation, State, Fax, CreatedById, Industry, AnnualRevenue, NumberOfEmployees FROM %s"%(self.TABLE_LEAD),
self.TABLE_OPPORTUNITY: "SELECT CreatedById, AccountId, Id, Name , Probability, NextStep, Amount, Description, OwnerId, StageName, CloseDate, Account.Name FROM %s"%(self.TABLE_OPPORTUNITY),
self.TABLE_CLAIM: "SELECT Id, CaseNumber, Subject, OwnerId, Description, CreatedById, Priority, ContactId, ClosedDate, Status FROM %s"%(self.TABLE_CLAIM),
@@ -125,6 +125,7 @@
name = 'partner_title_' + title
data = [title, title, domain]
return self.import_object(fields, data, 'res.partner.title', self.TABLE_CONTACT, name, [('domain', '=', domain), ('name', 'ilike', title)])
+ return False
def import_user(self, val):
user_obj = self.obj.pool.get('res.users')
@@ -218,6 +219,8 @@
address = {
'contact': {
'contact_name': vals.get('Name', ''),
+ 'function': vals.get('Title', ''),
+ 'title': self.get_title(vals ,vals.get('Salutation'), 'contact'),
'type': key,
'street': vals.get('MailingStreet', ''),
'zip': vals.get('MailingPostalCode', ''),
@@ -232,6 +235,8 @@
'other': {
'contact_name': vals.get('Name', ''),
'type': key,
+ 'title': self.get_title(vals ,vals.get('Salutation'), 'contact'),
+ 'function': vals.get('Title', ''),
'street': vals.get('OtherStreet', ''),
'zip': vals.get('OtherPostalCode', ''),
'city': vals.get('OtherCity', ''),
@@ -250,6 +255,8 @@
address_ids = []
address = {
'name': 'contact_name',
+ 'function': 'function',
+ 'title/id': 'title',
'type': 'type',
'street': 'street',
'zip': 'zip',
@@ -284,13 +291,15 @@
def get_contact_mapping(self):
return {
'model': 'res.partner',
- 'dependencies': [],
+ 'dependencies': [self.TABLE_USER, self.TABLE_ACCOUNT],
'map': {
'name': 'Name',
'customer': const('1'),
'supplier': const('0'),
- 'title/id': call(self.get_title, value('Title'), const('partner')),
'address/id': self.get_partner_address,
+ 'user_id/id': ref(self.TABLE_USER, 'OwnerId'),
+ 'parent_id/id': ref(self.TABLE_ACCOUNT, 'AccountId'),
+ 'comment': ppconcat('HomePhone', 'OtherPhone', 'ReportsTo', 'Birthdate', 'AssistantName', 'AssistantPhone', 'Languages__c', 'LeadSource', 'Description')
}
}
_______________________________________________
Mailing list: https://launchpad.net/~openerp-dev-gtk
Post to : [email protected]
Unsubscribe : https://launchpad.net/~openerp-dev-gtk
More help : https://help.launchpad.net/ListHelp