[Fix] Outlook: fix buildbot warnings

bzr revid: jam@tinyerp.com-20101116104219-wvwhkfxeiioh0ggw
This commit is contained in:
jam-openerp
2010-11-16 16:12:19 +05:30
parent 802a7eea9f
commit 286b86df98
2 changed files with 6 additions and 10 deletions
@@ -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)
@@ -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 ):