summaryrefslogtreecommitdiff
path: root/addons/import_google/wizard/import_google_data.py
diff options
context:
space:
mode:
authorDBR (OpenERP) <dbr@tinyerp.com>2011-06-16 15:51:05 +0530
committerDBR (OpenERP) <dbr@tinyerp.com>2011-06-16 15:51:05 +0530
commit02822e9648f7c2153cf6a30eaed3723cdc1dee64 (patch)
treebf4f2dc2f34320eca50864ffffde2b7a3465dc3e /addons/import_google/wizard/import_google_data.py
parentdbea57b5805660d06ec4fc57b39b314b122faa5e (diff)
[IMP]import_google : Improve the code for message box
bzr revid: dbr@tinyerp.com-20110616102105-y401kwlng6nl068g
Diffstat (limited to 'addons/import_google/wizard/import_google_data.py')
-rw-r--r--addons/import_google/wizard/import_google_data.py29
1 files changed, 21 insertions, 8 deletions
diff --git a/addons/import_google/wizard/import_google_data.py b/addons/import_google/wizard/import_google_data.py
index 46130dbb62a..3499d449b09 100644
--- a/addons/import_google/wizard/import_google_data.py
+++ b/addons/import_google/wizard/import_google_data.py
@@ -131,17 +131,14 @@ class synchronize_google(osv.osv_memory):
if not gd_client:
raise osv.except_osv(_('Error'), _("Please specify correct user and password !"))
if obj.group_name not in ['all']:
- query = gdata.contacts.service.ContactsQuery()
- query.group = obj.group_name
- contact = gd_client.GetContactsFeed(query.ToUri())
- else:
- contact = gd_client.GetContactsFeed()
+ context.update({ 'group_name': obj.group_name})
if obj.create_partner=='create_all':
tables.append('Contact')
else:
tables.append('Address')
- context.update({'gd_client':contact,
- 'client':gd_client,
+ context.update({'user': gmail_user,
+ 'password': gmail_pwd,
+ 'instance': 'contact',
'table':tables,
'customer':cust,
'supplier':sup})
@@ -163,7 +160,23 @@ class synchronize_google(osv.osv_memory):
imp = google_import(self, cr, uid,'import_google' , "synchronize_google", gmail_user, context)
imp.set_table_list(tables)
imp.start()
- return {}
+ #return {}
+ msg = " you're Contact import in background, a email will be send when the process is finished to %s"%(user_obj.gmail_user)
+ context.update({'message': msg})
+
+ obj_model = self.pool.get('ir.model.data')
+ model_data_ids = obj_model.search(cr,uid,[('model','=','ir.ui.view'),('name','=','view_google_import_message_form')])
+ resource_id = obj_model.read(cr, uid, model_data_ids, fields=['res_id'], context=context)[0]['res_id']
+
+ return {
+ 'view_type': 'form',
+ 'view_mode': 'form',
+ 'res_model': 'google.import.message',
+ 'views': [(resource_id,'form')],
+ 'type': 'ir.actions.act_window',
+ 'target': 'new',
+ 'context': context,
+ }
synchronize_google()