From a38515d9776f387f161bd496ac87b5895696e881 Mon Sep 17 00:00:00 2001 From: "DBR (OpenERP)" Date: Fri, 27 May 2011 17:17:35 +0530 Subject: [PATCH 1/3] Remove the Login wizard from the configuration bzr revid: dbr@tinyerp.com-20110527114735-9qk5bgke46jhurcs --- addons/import_google_contact/__init__.py | 1 - addons/import_google_contact/__openerp__.py | 1 - .../import_google_contact_installer.py | 59 ----------------- .../import_google_contact_installer_view.xml | 65 ------------------- .../wizard/google_contact_import.py | 23 +++++++ .../wizard/google_contact_import_view.xml | 15 ++++- 6 files changed, 36 insertions(+), 128 deletions(-) delete mode 100644 addons/import_google_contact/import_google_contact_installer.py delete mode 100644 addons/import_google_contact/import_google_contact_installer_view.xml diff --git a/addons/import_google_contact/__init__.py b/addons/import_google_contact/__init__.py index a12b018b1e1..e937eb08b0c 100644 --- a/addons/import_google_contact/__init__.py +++ b/addons/import_google_contact/__init__.py @@ -21,7 +21,6 @@ import import_google_contact import wizard -import import_google_contact_installer # vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: diff --git a/addons/import_google_contact/__openerp__.py b/addons/import_google_contact/__openerp__.py index 0f01cf605cb..6d19f2c6865 100644 --- a/addons/import_google_contact/__openerp__.py +++ b/addons/import_google_contact/__openerp__.py @@ -30,7 +30,6 @@ 'depends': ['base','google_base_account'], 'init_xml': [], 'update_xml': [ - 'import_google_contact_installer_view.xml', 'wizard/google_contact_import_view.xml' ], 'demo_xml': [], diff --git a/addons/import_google_contact/import_google_contact_installer.py b/addons/import_google_contact/import_google_contact_installer.py deleted file mode 100644 index 30e3b347603..00000000000 --- a/addons/import_google_contact/import_google_contact_installer.py +++ /dev/null @@ -1,59 +0,0 @@ -# -*- coding: utf-8 -*- -############################################################################## -# -# OpenERP, Open Source Management Solution -# Copyright (C) 2004-2010 Tiny SPRL (). -# -# 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 . -# -############################################################################## - -from osv import fields, osv -from tools.translate import _ -try: - 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')) - -class google_installer_crm(osv.osv_memory): - _name = 'google.installer.crm' - _inherit = 'res.config.installer' - _columns = { - 'user': fields.char('Google Username', size=64, required=True), - 'password': fields.char('Google Password', size=64) - } - - def google_login(self, user, password, type='group', context=None): - gd_client = gdata.contacts.service.ContactsService() - try: - gd_client.ClientLogin(user, password,gd_client.source) - except Exception: - return False - return gd_client - - def login(self, cr, uid, ids, context=None): - data = self.read(cr, uid, ids)[0] - user = data['user'] - password = data['password'] - if self.google_login(user, password): - res = { - 'gmail_user': user, - 'gmail_password': password - } - self.pool.get('res.users').write(cr, uid, uid, res, context=context) - else: - raise osv.except_osv(_('Error'), _("Authentication failed! Check the user and password !")) - return self.action_next(cr, uid, ids, context=context) - -google_installer_crm() diff --git a/addons/import_google_contact/import_google_contact_installer_view.xml b/addons/import_google_contact/import_google_contact_installer_view.xml deleted file mode 100644 index 28f9d31fada..00000000000 --- a/addons/import_google_contact/import_google_contact_installer_view.xml +++ /dev/null @@ -1,65 +0,0 @@ - - - - Google From - google.installer.crm - form - - - -
- Import your contacts from Google -
- - Enter Your Google Connection Data - - - Enter your Google login and password. It will give you the possibility to import and synchronize your Gmail contacts. - - - - -