summaryrefslogtreecommitdiff
path: root/addons/import_google/wizard/import_google.py
diff options
context:
space:
mode:
authorVijaykumar Baladaniya <vba@tinyerp.com>2012-07-09 18:31:13 +0530
committerVijaykumar Baladaniya <vba@tinyerp.com>2012-07-09 18:31:13 +0530
commitbe2e95656aaa113addea2b510fcdcf2f890eaaa4 (patch)
treeabcb3dd4ef350a1b8ad0eaffdd2b9a1cb91521af /addons/import_google/wizard/import_google.py
parentb982ea278b33132def3927417b7a854b98b5028a (diff)
parent3925f76ce85854e5d4834902a05f57bcfc5ace85 (diff)
[MERGE]merged with trunk-survey-layout-tta
bzr revid: vba@tinyerp.com-20120709130113-3lchipgil9oqpglg
Diffstat (limited to 'addons/import_google/wizard/import_google.py')
-rw-r--r--addons/import_google/wizard/import_google.py14
1 files changed, 8 insertions, 6 deletions
diff --git a/addons/import_google/wizard/import_google.py b/addons/import_google/wizard/import_google.py
index f241fabf412..9a9b2802826 100644
--- a/addons/import_google/wizard/import_google.py
+++ b/addons/import_google/wizard/import_google.py
@@ -28,6 +28,8 @@ from pytz import timezone
from datetime import datetime
import time
from osv import *
+from tools.translate import _
+
try:
import gdata
import gdata.contacts.service
@@ -284,8 +286,8 @@ class google_import(import_framework):
data['id'] = entry.id.text
name = tools.ustr(entry.title.text)
if name == "None":
- name = entry.email[0].address
- data['name'] = name
+ name = entry.email and entry.email[0].address or ''
+ data['name'] = name or _('Unknown')
emails = ','.join(email.address for email in entry.email)
data['email'] = emails
if table == 'Contact':
@@ -314,13 +316,13 @@ class google_import(import_framework):
def get_contact_mapping(self):
return {
'model': 'res.partner',
- 'dependencies': [self.TABLE_ADDRESS],
+ #'dependencies': [self.TABLE_ADDRESS],
'map': {
'id':'id',
'name': value('company', fallback='name'),
'customer': 'customer',
'supplier': 'supplier',
- 'address/id': ref(self.TABLE_ADDRESS, 'id'),
+ 'child_ids/id': ref(self.TABLE_ADDRESS, 'id'),
}
}
@@ -337,11 +339,11 @@ class google_import(import_framework):
def get_address_mapping(self):
return {
- 'model': 'res.partner.address',
+ 'model': 'res.partner',
'dependencies': [],
'map': {
'id':'id',
- 'partner_id/.id': self.get_partner_id,
+ 'parent_id/.id': self.get_partner_id,
'name': 'name',
'city': 'city',
'phone': 'phone',