diff --git a/addons/outlook/plugin/openerp-outlook-plugin/addin.py b/addons/outlook/plugin/openerp-outlook-plugin/addin.py index 130d8b6e19e..b75342e9996 100644 --- a/addons/outlook/plugin/openerp-outlook-plugin/addin.py +++ b/addons/outlook/plugin/openerp-outlook-plugin/addin.py @@ -90,10 +90,10 @@ class ViewPartners: self.outlook = Dispatch("Outlook.Application") self.ex = self.outlook.ActiveExplorer() if self.ex: - is_login = str(data['login']) + is_login = str(self.data['login']) if is_login == 'False': win32ui.MessageBox("Please login to the database first", "OpenERP Connection", win32con.MB_ICONEXCLAMATION) - elif self.ex.Selection.Count == 1 or ex.Selection.Count == 0: + elif self.ex.Selection.Count == 1 or self.ex.Selection.Count == 0: self.mngr = manager.GetManager() self.mngr.ShowManager("IDD_VIEW_PARTNER_DIALOG") elif self.ex.Selection.Count > 1: @@ -117,13 +117,12 @@ class OpenPartner: def OnClick(self, button, cancel): import win32ui - from manager import ustr self.mngr = manager.GetManager() self.data = self.mngr.LoadConfig() self.outlook = Dispatch("Outlook.Application") self.ex = self.outlook.ActiveExplorer() if ex: - is_login = str(data['login']) + is_login = str(self.data['login']) if is_login == 'False': win32ui.MessageBox("Please login to the database first", "OpenERP Connection", win32con.MB_ICONEXCLAMATION) elif self.ex.Selection.Count == 1: @@ -158,11 +157,11 @@ class OpenDocument: self.outlook = Dispatch("Outlook.Application") self.ex = self.outlook.ActiveExplorer() if self.ex: - is_login = str(data['login']) + is_login = str(self.data['login']) if is_login == 'False': win32ui.MessageBox("Please login to the database first", "OpenERP Connection", win32con.MB_ICONEXCLAMATION) - elif self.ex.Selection.Count == 1 or ex.Selection.Count == 0: - self.mngr = manager.GetManager() + elif self.ex.Selection.Count == 1 or self.ex.Selection.Count == 0: + self.mngr = self.manager.GetManager() self.mngr.ShowManager("IDD_OPEN_DOCUEMNT_DIALOG") elif self.ex.Selection.Count > 1: win32ui.MessageBox("Multiple selection not allowed. Please select only one mail at a time.","Open Document",win32con.MB_ICONINFORMATION) diff --git a/addons/outlook/plugin/openerp-outlook-plugin/eml.py b/addons/outlook/plugin/openerp-outlook-plugin/eml.py index 4abee63a041..cca4a26493e 100644 --- a/addons/outlook/plugin/openerp-outlook-plugin/eml.py +++ b/addons/outlook/plugin/openerp-outlook-plugin/eml.py @@ -25,7 +25,6 @@ import sys import chilkat import os from manager import ustr -import win32ui import email cemail = chilkat.CkEmail() dt = chilkat.SYSTEMTIME() @@ -34,7 +33,6 @@ def generateEML(mail): body = mail.Body.encode("utf-8") recipients = mail.Recipients sender_email = mail.SenderEmailAddress - sender_name = mail.SenderEmailAddress attachments=mail.Attachments cemail = chilkat.CkEmail() @@ -69,7 +67,6 @@ def generateEML(mail): att_file = os.path.join(attachments_folder_path, fn) if os.path.exists(att_file): os.remove(att_file) - f1 = att_file attachments[i].SaveAsFile(att_file) contentType = cemail.addFileAttachment(att_file) if (contentType == None ):