summaryrefslogtreecommitdiff
path: root/addons/import_google/wizard
diff options
context:
space:
mode:
authorAjay Chauhan (OpenERP) <cha@tinyerp.com>2012-10-01 14:47:30 +0530
committerAjay Chauhan (OpenERP) <cha@tinyerp.com>2012-10-01 14:47:30 +0530
commitd2b51d4e149e8542f77fd2a171d0a4498352be2d (patch)
tree0e10ae6b0e694692df4260a65f2b7ac88c9573ca /addons/import_google/wizard
parent826e2b8fdbb267efab4feff67e373e0e0c1c1568 (diff)
parent3686a01df372b01dcec9a5438ba9b16256895c5e (diff)
[MERGE] merge with lp:openobject-addons
bzr revid: cha@tinyerp.com-20121001091730-q6sbcvj7nu53t91h
Diffstat (limited to 'addons/import_google/wizard')
-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" />