From a01c3728c51caded70cc4980e8d3113ff2de11bb Mon Sep 17 00:00:00 2001 From: jam-openerp Date: Mon, 13 Dec 2010 11:50:58 +0530 Subject: [PATCH] [IMP] 1) Openlink in Webbrowser with menu 2) Putting Config in Toolbar bzr revid: jam@tinyerp.com-20101213062058-j0cue0r4xtvho8o7 --- .../plugin/openerp-outlook-plugin/addin.py | 8 ++++++++ .../openerp-outlook-plugin/dialogs/dialog_map.py | 16 ++++++++-------- 2 files changed, 16 insertions(+), 8 deletions(-) diff --git a/addons/outlook/plugin/openerp-outlook-plugin/addin.py b/addons/outlook/plugin/openerp-outlook-plugin/addin.py index 2cd8bf565b1..39ea41d7f16 100644 --- a/addons/outlook/plugin/openerp-outlook-plugin/addin.py +++ b/addons/outlook/plugin/openerp-outlook-plugin/addin.py @@ -175,6 +175,12 @@ class OutlookAddin: toolbar = bars.Item("Standard") openerp_bar = bars.Item('Open ERP') + item = openerp_bar.Controls.Add(Type = constants.msoControlButton, Temporary = True) + item = self.toolbarButtonConfig = DispatchWithEvents(item, Configuration) + item.Caption = "Configuration" + item.TooltipText = "Click to configure OpenERP." + item.Enabled = True + item = openerp_bar.Controls.Add(Type=constants.msoControlButton, Temporary=True) # Hook events for the item item = self.toolbarButton = DispatchWithEvents(item, ArchiveEvent) @@ -198,6 +204,8 @@ class OutlookAddin: item.TooltipText = "Click to Open Document that has been pushed to server." item.Enabled = True + + # Hook events for the item # item = toolbarweb.Controls.Add(Type = constants.msoControlButton, Temporary = True) # item = self.toolbarButtonPartner = DispatchWithEvents(item, ViewPartners) diff --git a/addons/outlook/plugin/openerp-outlook-plugin/dialogs/dialog_map.py b/addons/outlook/plugin/openerp-outlook-plugin/dialogs/dialog_map.py index 747915f7181..140c100f229 100644 --- a/addons/outlook/plugin/openerp-outlook-plugin/dialogs/dialog_map.py +++ b/addons/outlook/plugin/openerp-outlook-plugin/dialogs/dialog_map.py @@ -1406,14 +1406,11 @@ def OpenPartnerForm(txtProcessor,*args): txtProcessor.init_done=True return try: - linktopartner = "http://"+web_server+":"+str(web_server_port)+"/openerp/form/view?model=res.partner&id="+str(vals) - + import urllib + next = urllib.urlencode({'next' : '/openerp/form/view?model=res.partner&id=' +str(vals) }) + weburl = 'http://'+web_server+':'+str(web_server_port)+'/' + linktopartner = weburl + '?' + next win32gui.SendMessage(partner_link, win32con.WM_SETTEXT, 0, str(linktopartner)) -# import urllib -# encode = urllib.urlencode('/openerp/form/view?model=res.partner&id='+str(vals)) -# weburl = 'http://'+web_server+':'+str(web_server_port) -# linktopartner = weburl + "?next=" + encode -# win32gui.SendMessage(partner_link, win32con.WM_SETTEXT, 0, linktopartner) except Exception,e: win32ui.MessageBox("Error While Opening Partner.\n"+str(e),"Open Partner", flag_error) webbrowser.open_new(linktopartner) @@ -1469,7 +1466,10 @@ def SerachOpenDocuemnt(txtProcessor,*args): txtProcessor.init_done=True return try: - linktodoc = "http:\\\\" +web_server+ ":"+str(web_server_port)+"\\openerp\\form\\view?model="+vals[0][1]+"&id="+str(vals[1][1]) + import urllib + next = urllib.urlencode({'next' : '/openerp/form/view?model='+vals[0][1]+'&id='+str(vals[1][1])}) + weburl = 'http://'+web_server+':'+str(web_server_port)+'/' + linktodoc = weburl + '?' + next win32gui.SendMessage(link_box, win32con.WM_SETTEXT, 0, str(linktodoc)) except Exception,e: win32ui.MessageBox("Error While Opening Document.\n"+str(e),"Open Document", flag_error)