[ADD] Add google_conact module

bzr revid: sbh@tinyerp.com-20110209104555-l3txskncpjnfxvyc
This commit is contained in:
Sbh (OpenERP) 2011-02-09 16:15:55 +05:30
parent 7b6e366a5f
commit 8e58b5191a
5 changed files with 186 additions and 0 deletions

View File

@ -0,0 +1,24 @@
# -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# published by the Free Software Foundation, either version 3 of the
# License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Affero General Public License for more details.
#
# You should have received a copy of the GNU Affero General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
##############################################################################
import google_contact
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:

View File

@ -0,0 +1,40 @@
# -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# published by the Free Software Foundation, either version 3 of the
# License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Affero General Public License for more details.
#
# You should have received a copy of the GNU Affero General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
##############################################################################
{
'name': 'Google Contact',
'version': '1.0',
'category': 'Generic Modules/Others',
'description': """The module adds google contact in partner address""",
'author': 'OpenERP SA',
'website': 'http://www.openerp.com',
'depends': ['base'],
'init_xml': [],
'update_xml': [
# 'google_contact_view.xml'
],
'demo_xml': [],
'installable': True,
'active': False,
'certificate': '',
}
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:

View File

@ -0,0 +1,32 @@
# -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# published by the Free Software Foundation, either version 3 of the
# License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Affero General Public License for more details.
#
# You should have received a copy of the GNU Affero General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
##############################################################################
from osv import fields,osv,orm
try:
import gdata
from gdata import contacts
import gdata.contacts.service
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'))
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:

View File

@ -0,0 +1,50 @@
<?xml version="1.0"?>
<openerp>
<data>
<record model="ir.ui.view" id="view_google_contact_form">
<field name="name">google.contact.form</field>
<field name="model">google.contact</field>
<field name="type">form</field>
<field name="arch" type="xml">
<form string="Google Contact">
<group colspan="2" col="2">
<field name="user"/>
<field name="password" password="True"/>
</group>
<separator string="" colspan="4" />
<group colspan="2" col="2">
<button special="cancel" string="Cancel" icon="gtk-cancel"/>
<button name="get_contact" string="Contact " type="object" icon="terp-mail-message-new"/>
</group>
</form>
</field>
</record>
<record model="ir.ui.view" id="view_google_contact_tree">
<field name="name">google.contact.tree</field>
<field name="model">google.contact</field>
<field name="type">tree</field>
<field name="arch" type="xml">
<tree string="Google Contact">
<field name="user"/>
<field name="password" password="True"/>
</tree>
</field>
</record>
<menuitem id="base.menu_sales" name="Sales"
parent="base.menu_base_partner" sequence="1" />
<record model="ir.actions.act_window" id="google_contact_act">
<field name="name">Google Contact</field>
<field name="res_model">google.contact</field>
<field name="view_mode">tree,form,</field>
<field name="view_id" ref="view_google_contact_tree"/>
</record>
<menuitem name="Google Contact" id="menu_google_contact"
parent="base.menu_sales" action="google_contact_act"
sequence="2" />
</data>
</openerp>

View File

@ -0,0 +1,40 @@
# -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# published by the Free Software Foundation, either version 3 of the
# License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Affero General Public License for more details.
#
# You should have received a copy of the GNU Affero General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
##############################################################################
# demo script for geeting contact detail'
import sys
import getopt
import getpass
import atom
import gdata.contacts
import gdata.contacts.service
email='user name of gmail'
password='add the password'
gd_client = gdata.contacts.service.ContactsService()
gd_client.email = email
gd_client.password = password
gd_client.source = 'GoogleInc-ContactsPythonSample-1'
gd_client.ProgrammaticLogin()
feed= gd_client.GetContactsFeed()
next = feed.GetNextLink()
for i, entry in enumerate(feed.entry):
print entry.title.text