summaryrefslogtreecommitdiff
path: root/addons/import_google
diff options
context:
space:
mode:
authorFabien Meghazi <fme@openerp.com>2012-10-02 09:49:31 +0200
committerFabien Meghazi <fme@openerp.com>2012-10-02 09:49:31 +0200
commit4d2299adc4e9d7db2cb52a79cf4ab8ebaad707ae (patch)
tree8a45a95b39d3b060fdef188f3da8a70fbfe20ad5 /addons/import_google
parent32d492acf9db0a57487a1c6c47e4311d842e99f7 (diff)
parenta5fac44994a5d2c0e20cdde0bf72ef152d2342dd (diff)
[MERGE] trunk
bzr revid: fme@openerp.com-20121002074931-845aiqhflw2rqrcn
Diffstat (limited to 'addons/import_google')
-rw-r--r--addons/import_google/wizard/google_import_message_view.xml3
-rw-r--r--addons/import_google/wizard/import_google.py11
-rw-r--r--addons/import_google/wizard/import_google_data.py2
-rw-r--r--addons/import_google/wizard/import_google_data_view.xml4
4 files changed, 16 insertions, 4 deletions
diff --git a/addons/import_google/wizard/google_import_message_view.xml b/addons/import_google/wizard/google_import_message_view.xml
index 158aff29bf3..d44bd8e26ec 100644
--- a/addons/import_google/wizard/google_import_message_view.xml
+++ b/addons/import_google/wizard/google_import_message_view.xml
@@ -10,6 +10,9 @@
<group>
<field name='name'/>
</group>
+ <footer>
+ <button string="Close" class="oe_highlight" special="cancel" />
+ </footer>
</form>
</field>
</record>
diff --git a/addons/import_google/wizard/import_google.py b/addons/import_google/wizard/import_google.py
index d231c186321..f8fc8991975 100644
--- a/addons/import_google/wizard/import_google.py
+++ b/addons/import_google/wizard/import_google.py
@@ -27,6 +27,7 @@ from dateutil import *
from pytz import timezone
from datetime import datetime
import time
+import base64
from osv import *
from tools.translate import _
@@ -282,7 +283,7 @@ class google_import(import_framework):
self.contact = self.gd_client.GetContactsFeed()
while self.contact:
for entry in self.contact.entry:
- data = {}
+ data = {}
data['id'] = entry.id.text
name = tools.ustr(entry.title.text)
if name == "None":
@@ -290,6 +291,8 @@ class google_import(import_framework):
data['name'] = name or _('Unknown')
emails = ','.join(email.address for email in entry.email)
data['email'] = emails
+ if self.gd_client.GetPhoto(entry):
+ data['image'] = base64.encodestring(self.gd_client.GetPhoto(entry))
if table == 'Contact':
data.update({'customer': str(self.context.get('customer')),
'supplier': str(self.context.get('supplier'))})
@@ -322,6 +325,12 @@ class google_import(import_framework):
'name': value('company', fallback='name'),
'customer': 'customer',
'supplier': 'supplier',
+ 'city': 'city',
+ 'phone': 'phone',
+ 'mobile': 'mobile',
+ 'email': 'email',
+ 'image': 'image',
+ 'fax': 'fax',
'child_ids/id': ref(self.TABLE_ADDRESS, 'id'),
}
}
diff --git a/addons/import_google/wizard/import_google_data.py b/addons/import_google/wizard/import_google_data.py
index 2132d141e29..5ce1d160f3e 100644
--- a/addons/import_google/wizard/import_google_data.py
+++ b/addons/import_google/wizard/import_google_data.py
@@ -104,7 +104,7 @@ class synchronize_google(osv.osv_memory):
_columns = {
'customer': fields.boolean('Customer', help="Check this box to set newly created partner as Customer."),
'supplier': fields.boolean('Supplier', help="Check this box to set newly created partner as Supplier."),
- 'group_name': fields.selection(_get_group, "Group Name",help="Choose which group to import, By default it takes all."),
+ 'group_name': fields.selection(_get_group, "Group Name", help="Choose which group to import, By default it takes all."),
'calendar_name': fields.selection(_get_calendars, "Calendar Name"),
}
diff --git a/addons/import_google/wizard/import_google_data_view.xml b/addons/import_google/wizard/import_google_data_view.xml
index f8e110e6a5d..e11b5aa2d08 100644
--- a/addons/import_google/wizard/import_google_data_view.xml
+++ b/addons/import_google/wizard/import_google_data_view.xml
@@ -7,7 +7,7 @@
<field name="arch" type="xml">
<form string="Import contacts from a google account" version="7.0">
<group colspan="4" col="4" width="430">
- <field name="group_name" colspan="4"/>
+ <field name="group_name" colspan="4" required="1"/>
<newline/>
<group colspan="4" col="4">
<separator string="Partner Status for this Group:" colspan="4"/>
@@ -32,7 +32,7 @@
<field name="arch" type="xml">
<form string="Import Google Calendar Events" version="7.0">
<group colspan="4" col="4" width="320">
- <field name="calendar_name" />
+ <field name="calendar_name" required="1"/>
</group>
<footer>
<button name="import_google" string="_Import Events" type="object" class="oe_highlight" />