From 9b5c16eff3ca6a51b8e1fbbf2b74f4ac894d8e60 Mon Sep 17 00:00:00 2001 From: "Ysa (Open ERP)" Date: Thu, 22 Apr 2010 17:15:02 +0530 Subject: [PATCH] [ADD] Thuderbird :- add configuration wizard. bzr revid: ysa@tinyerp.co.in-20100422114502-c1j5f8oxkkohl9nm --- addons/base_setup/base_setup_installer.xml | 2 +- addons/base_setup/installer.py | 1 + addons/thunderbird/__init__.py | 2 +- addons/thunderbird/__openerp__.py | 3 +- addons/thunderbird/installer.py | 53 ++++++++++ addons/thunderbird/thunderbird_installer.xml | 103 +++++++++++++++++++ 6 files changed, 161 insertions(+), 3 deletions(-) create mode 100644 addons/thunderbird/installer.py create mode 100644 addons/thunderbird/thunderbird_installer.xml diff --git a/addons/base_setup/base_setup_installer.xml b/addons/base_setup/base_setup_installer.xml index 7a6d61a0e08..594133d3b12 100644 --- a/addons/base_setup/base_setup_installer.xml +++ b/addons/base_setup/base_setup_installer.xml @@ -28,7 +28,7 @@ If you don't think you need any of these right now, you can easily install them - + diff --git a/addons/base_setup/installer.py b/addons/base_setup/installer.py index 2c1ba113e47..9a817eaf10e 100644 --- a/addons/base_setup/installer.py +++ b/addons/base_setup/installer.py @@ -73,6 +73,7 @@ class base_setup_installer(osv.osv_memory): 'report_designer':fields.boolean('Advanced Reporting', help="Lets you install various tools to simplify and enhance " "OpenERP's report creation."), + 'thunderbird' :fields.boolean('Thunderbird'), # Vertical modules 'profile_association':fields.boolean('Associations', help="Installs a preselected set of OpenERP " diff --git a/addons/thunderbird/__init__.py b/addons/thunderbird/__init__.py index 5b7582a98f0..4ab5861f126 100644 --- a/addons/thunderbird/__init__.py +++ b/addons/thunderbird/__init__.py @@ -47,4 +47,4 @@ ############################################################################## import partner - +import installer diff --git a/addons/thunderbird/__openerp__.py b/addons/thunderbird/__openerp__.py index 2cb470bf886..5e60f6508cc 100644 --- a/addons/thunderbird/__openerp__.py +++ b/addons/thunderbird/__openerp__.py @@ -39,7 +39,8 @@ Select a section for which you want to create case.''', "init_xml" : [], "demo_xml" : [], - "update_xml" : ['security/ir.model.access.csv'], + "update_xml" : ['thunderbird_installer.xml', + 'security/ir.model.access.csv'], "active": False, "installable": True } diff --git a/addons/thunderbird/installer.py b/addons/thunderbird/installer.py new file mode 100644 index 00000000000..69576aa2a46 --- /dev/null +++ b/addons/thunderbird/installer.py @@ -0,0 +1,53 @@ +# -*- coding: utf-8 -*- +############################################################################## +# +# OpenERP, Open Source Management Solution +# Copyright (C) 2004-2009 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 +from osv import osv +from tools import config + +import base64 + +class thunderbird_installer(osv.osv_memory): + _name = 'thunderbird.installer' + _inherit = 'res.config.installer' + + def process_plugin(self, cr, uid, ids, context): + """ + Default Attach Thunderbird Plug-in File. + """ + data = {} + file = open(config['addons_path'] + "/thunderbird/plugin/tiny_plugin-2.0.xpi", 'r') + data['plugin_file'] = base64.encodestring(file.read()) + self.write(cr, uid, ids, data) + return False + + _columns = { + 'name':fields.char('File name', size=34, required=True, help='Save Thunderbird plugin file.'), + 'thunderbird':fields.boolean('Thunderbird Module ', help="Allows you to select an object that you’d like to add to your email and its attachments."), + 'plugin_file':fields.binary('Thunderbird Plug-in', readonly=True, help="Thunderbird plug-in file. Save as this file and install this plug-in in thunderbir."), + + } + _defaults = { + 'thunderbird' : True, + 'name' : 'tiny_plugin-2.0.xpi', + } + +thunderbird_installer() diff --git a/addons/thunderbird/thunderbird_installer.xml b/addons/thunderbird/thunderbird_installer.xml new file mode 100644 index 00000000000..bd19a780456 --- /dev/null +++ b/addons/thunderbird/thunderbird_installer.xml @@ -0,0 +1,103 @@ + + + + + thunderbird.installer.view + thunderbird.installer + form + + + +
+ Thunderbird Module Installation +
+ + Configure Thunderbird Module + + + This module is required for the thuderbird plug-in to work properly.This allows you to select an object that you had like to add to your email and its attachments. You can select a partner, a task, a project, an analytical account, or any other object and attach selected mail as .eml file in attachment of selected record. + + + + + + + + +