bzr revid: sbh@tinyerp.com-20110325123334-00dj6u5w8w52d31n
This commit is contained in:
Bhumika (OpenERP)
2011-03-25 18:03:34 +05:30
2 changed files with 3 additions and 8 deletions
@@ -35,11 +35,7 @@ class google_login(osv.osv_memory):
}
def google_login(self, user, password, type='group', context=None):
gd_client=False
if type=='group':
gd_client=gdata.contacts.client.ContactsClient(source='OpenERP')
if type=='contact' :
gd_client = gdata.contacts.service.ContactsService()
gd_client = gdata.contacts.service.ContactsService()
try:
gd_client.ClientLogin(user, password,gd_client.source)
except Exception:
@@ -26,7 +26,6 @@ try:
import gdata
import gdata.contacts.service
import gdata.contacts
import gdata.contacts.client
except ImportError:
raise osv.except_osv(_('Google Contacts Import Error!'), _('Please install gdata-python-client from http://code.google.com/p/gdata-python-client/downloads/list'))
@@ -66,10 +65,10 @@ class synchronize_google_contact(osv.osv_memory):
if not gd_client:
raise osv.except_osv(_('Error'), _("Authentication fail check the user and password !"))
query = gdata.contacts.client.ContactsQuery(feed='/m8/feeds/groups/default/full')
res = []
query = gdata.contacts.service.GroupsQuery(feed='/m8/feeds/groups/default/full')
if gd_client:
groups = gd_client.GetGroups(q=query)
groups = gd_client.GetFeed(query.ToUri())
for grp in groups.entry:
res.append((grp.id.text, grp.title.text))
res.append(('all','All Groups'))