diff --git a/addons/thunderbird/installer.py b/addons/thunderbird/installer.py index ac988425342..017b2ff651a 100644 --- a/addons/thunderbird/installer.py +++ b/addons/thunderbird/installer.py @@ -2,7 +2,7 @@ ############################################################################## # # OpenERP, Open Source Management Solution -# Copyright (C) 2004-2009 Tiny SPRL (). +# 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 @@ -34,7 +34,7 @@ class thunderbird_installer(osv.osv_memory): data = super(thunderbird_installer, self).default_get(cr, uid, fields, context) pdf_file = open(addons.get_module_resource('thunderbird','doc', 'Installation Guide to OpenERP Thunderbid Plug-in.pdf'),'rb') data['pdf_file'] = base64.encodestring(pdf_file.read()) - file = open(addons.get_module_resource('thunderbird','plugin', 'Openerp_plugin.xpi'),'rb') + file = open(addons.get_module_resource('thunderbird','plugin', 'openerp_plugin.xpi'),'rb') data['plugin_file'] = base64.encodestring(file.read()) return data @@ -49,9 +49,16 @@ class thunderbird_installer(osv.osv_memory): _defaults = { 'thunderbird' : True, - 'name' : 'Openerp_plugin.xpi', + 'name' : 'openerp_plugin.xpi', 'pdf_name' : 'Installation Guide to OpenERP Thunderbid Plug-in.pdf', - 'description' : """ * Save the Thunderbird plug­in. \n * Follows the following step to install Thunderbird plug­in. \n -> 1.From Menu Bar of Thunderbird, open Tools ­> Add ons. \n -> 2. Click on install button and a browser window appears. \n -> 3. Select the plug-in(.xpi file) and click Ok. \n -> 4. Software installation window appears and within a short time “Install Now” button will be enabled -> 5. Click "Install Now". \n -> 6. Restart Thunderbird.""" - } + 'description' : """* Save the Thunderbird plug­in. +* Follows the following step to install Thunderbird plug­in. + 1. From Menu Bar of Thunderbird, open Tools ­> Add ons. + 2. Click on install button and a browser window appears. + 3. Select the plug-in(.xpi file) and click Ok. + 4. Software installation window appears and within a short time “Install Now” button will be enabled. + 5. Click "Install Now". + 6. Restart Thunderbird.""" + } thunderbird_installer() diff --git a/addons/thunderbird/partner/partner.py b/addons/thunderbird/partner/partner.py index 69ee8214619..986c9ae063d 100644 --- a/addons/thunderbird/partner/partner.py +++ b/addons/thunderbird/partner/partner.py @@ -26,47 +26,24 @@ import base64 import netsvc from tools.translate import _ -class tinythunderbird_partner(osv.osv): - - def _links_get(self, cr, uid, context={}): - obj = self.pool.get('res.request.link') - ids = obj.search(cr, uid, []) - res = obj.read(cr, uid, ids, ['object', 'name'], context) - - return [(r['object'], r['name']) for r in res] - - _name = "tinythunderbird.partner" +class thunderbird_partner(osv.osv_memory): + _name = "thunderbird.partner" _description="Thunderbid mails" _rec_name="sender" - _columns = { - 'sender':fields.char("Sender",size=128,required=True,select=True), - 'receiver':fields.text("Receiver"), - "copy_to":fields.text("Copy To"), - "date":fields.date("Date",select=True), - "title":fields.char("Subject",size=128,select=True), - "description":fields.text("Description"), - "reference":fields.reference("Reference", selection=_links_get, size=128), - "res_user_id":fields.many2one("res.users","User"), - "attachments":fields.text("Attached Files",readonly=True), - } - _defaults = { - 'res_user_id':lambda obj,cr,uid,context: uid, - 'date': lambda *a: time.strftime('%Y-%m-%d') - } - + def mailcreate(self,cr,user,vals): dictcreate = dict(vals) import email header_name = email.Header.decode_header(dictcreate['name']) dictcreate['name'] = header_name and header_name[0] and header_name[0][0] - address_obj=self.pool.get('res.partner.address') - case_pool=self.pool.get(dictcreate.get('object','crm.lead')) - partner_ids=address_obj.search(cr,user,[('email','=',dictcreate['email_from'])]) - partner=address_obj.read(cr,user,partner_ids,['partner_id','name']) + address_obj = self.pool.get('res.partner.address') + case_pool = self.pool.get(dictcreate.get('object','crm.lead')) + partner_ids = address_obj.search(cr,user,[('email','=',dictcreate['email_from'])]) + partner = address_obj.read(cr,user,partner_ids,['partner_id','name']) if partner and partner[0] and partner[0]['partner_id']: dictcreate.update({'partner_id':partner[0]['partner_id'][0],'partner_name':partner[0]['name']}) create_id = case_pool.create(cr, user, dictcreate) - cases=case_pool.browse(cr,user,[create_id]) + cases = case_pool.browse(cr,user,[create_id]) case_pool._history(cr, user, cases, _('Archive'), history=True, email=False) return create_id @@ -248,4 +225,4 @@ class tinythunderbird_partner(osv.osv): object += "null," return object -tinythunderbird_partner() +thunderbird_partner() diff --git a/addons/thunderbird/plugin/openerp_plugin.xpi b/addons/thunderbird/plugin/openerp_plugin.xpi new file mode 100644 index 00000000000..3f9e87c1618 Binary files /dev/null and b/addons/thunderbird/plugin/openerp_plugin.xpi differ diff --git a/addons/thunderbird/plugin/openerp_plugin/chrome.manifest b/addons/thunderbird/plugin/openerp_plugin/chrome.manifest new file mode 100755 index 00000000000..5fa9c2f5754 --- /dev/null +++ b/addons/thunderbird/plugin/openerp_plugin/chrome.manifest @@ -0,0 +1,5 @@ +content openerp_plugin jar:chrome/openerp_plugin.jar!/content/ +overlay chrome://messenger/content/messenger.xul chrome://openerp_plugin/content/overlay.xul +locale openerp_plugin en-US jar:chrome/openerp_plugin.jar!/locale/en-US/ +skin openerp_plugin classic/1.0 jar:chrome/openerp_plugin.jar!/skin/ +#style chrome://global/content/customizeToolbar.xul chrome://openerp_plugin/skin/overlay.css diff --git a/addons/thunderbird/plugin/openerp_plugin/chrome/openerp_plugin/content/address.xul b/addons/thunderbird/plugin/openerp_plugin/chrome/openerp_plugin/content/address.xul new file mode 100644 index 00000000000..02700277d26 --- /dev/null +++ b/addons/thunderbird/plugin/openerp_plugin/chrome/openerp_plugin/content/address.xul @@ -0,0 +1,115 @@ + + + + + + + + + + + + + &name.value; + + + + + &contactname.value; + + + + + + + + + + + + + &street.value; + + + + + &office.value; + + + + + + + + + &street2.value; + + + + + &fax.value; + + + + + + + + + &zip.value; + + + + + &mobile.value; + + + + + + + + + &city.value; + + + + + &email.value; + + + + + + + + + + + + + + + + +