summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorjam-openerp <jam@tinyerp.com>2010-12-17 11:58:52 +0530
committerjam-openerp <jam@tinyerp.com>2010-12-17 11:58:52 +0530
commitfce3cd4fee55769666db07e9df1b02a7fe94cda7 (patch)
treee847a115d7eb386933bccddffd3f22558b9d654d
parent24b92f599ff5dcac9b3543b82b757fd94b40a573 (diff)
[IMP] Outlook Improvements
bzr revid: jam@tinyerp.com-20101217062852-bqdmewmhsswavz77
-rw-r--r--addons/outlook/plugin/openerp-outlook-plugin/addin.py2
-rw-r--r--addons/outlook/plugin/openerp-outlook-plugin/dialogs/dialog_map.py23
-rw-r--r--addons/outlook/plugin/openerp-outlook-plugin/tiny_xmlrpc.py13
3 files changed, 22 insertions, 16 deletions
diff --git a/addons/outlook/plugin/openerp-outlook-plugin/addin.py b/addons/outlook/plugin/openerp-outlook-plugin/addin.py
index 39ea41d7f16..5872ed0291a 100644
--- a/addons/outlook/plugin/openerp-outlook-plugin/addin.py
+++ b/addons/outlook/plugin/openerp-outlook-plugin/addin.py
@@ -204,8 +204,6 @@ 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 140c100f229..7861beb9442 100644
--- a/addons/outlook/plugin/openerp-outlook-plugin/dialogs/dialog_map.py
+++ b/addons/outlook/plugin/openerp-outlook-plugin/dialogs/dialog_map.py
@@ -705,22 +705,18 @@ def GetSearchText(txtProcessor,*args):
b = check()
if not b:
return
-
- search_box = txtProcessor.GetControl()
- global search_text
- if txtProcessor.init_done:
- win32gui.SendMessage(search_box, win32con.WM_SETTEXT, 0,search_text)
- return
-
# Get the selected mail and set the default value for search_text_control to mail.SenderEmailAddress
ex = txtProcessor.window.manager.outlook.ActiveExplorer()
assert ex.Selection.Count == 1
mail = ex.Selection.Item(1)
try:
- search_text = ustr(mail.SenderEmailAddress).encode('iso-8859-1')
- except Exception:
- pass
- win32gui.SendMessage(search_box, win32con.WM_SETTEXT, 0, search_text)
+ global objects_with_match
+ list_hwnd = win32gui.GetDlgItem(txtProcessor.window.hwnd, txtProcessor.other_ids[1])
+ objects_with_match = NewConn.SearchPartners()
+ setList(list_hwnd)
+ except Exception,e:
+ msg=getMessage(e)
+ win32ui.MessageBox('Document can not be loaded.\n'+str(e), "Push", flag_error)
txtProcessor.init_done=True
def SetNameColumn(listProcessor,*args):
@@ -1695,12 +1691,13 @@ dialog_map = {
(CommandButtonProcessor, "ID_SEARCH ID_SEARCH_TEXT IDC_NAME_LIST", SearchObjectsForText,()),
(GroupProcessor, "IDC_STATIC_GROUP", setCheckList, ()),
(CSComboProcessor, "ID_ATT_METHOD_DROPDOWNLIST", GetConn,()),
- (TextProcessor, "ID_SEARCH_TEXT", GetSearchText, ()),
(DialogCommand, "ID_CREATE_CONTACT ID_SEARCH_TEXT", "IDD_NEW_CONTACT_DIALOG", set_search_text, ()),
(CloseButtonProcessor, "IDCANCEL"),
(CommandButtonProcessor, "ID_MAKE_ATTACHMENT IDC_NAME_LIST IDD_SYNC", MakeAttachment, ()),
(CommandButtonProcessor, "ID_CREATE_CASE ID_ATT_METHOD_DROPDOWNLIST IDC_NAME_LIST IDD_SYNC", CreateCase, ()),
- (ListBoxProcessor, "IDC_NAME_LIST", SetNameColumn, ())
+ (ListBoxProcessor, "IDC_NAME_LIST", SetNameColumn, ()),
+ (TextProcessor, "ID_SEARCH_TEXT ID_SEARCH_TEXT IDC_NAME_LIST", GetSearchText, ()),
+
),
"IDD_NEW_CONTACT_DIALOG" : (
diff --git a/addons/outlook/plugin/openerp-outlook-plugin/tiny_xmlrpc.py b/addons/outlook/plugin/openerp-outlook-plugin/tiny_xmlrpc.py
index 653ad229e1d..7c9af5d28b2 100644
--- a/addons/outlook/plugin/openerp-outlook-plugin/tiny_xmlrpc.py
+++ b/addons/outlook/plugin/openerp-outlook-plugin/tiny_xmlrpc.py
@@ -59,7 +59,7 @@ class XMLRpcConn(object):
'ArchiveToOpenERP', 'IsCRMInstalled', 'GetPartners', 'GetObjectItems', \
'CreateCase', 'MakeAttachment', 'CreateContact', 'CreatePartner', 'getitem', 'setitem', \
'SearchPartnerDetail', 'WritePartnerValues', 'GetAllState', 'GetAllCountry', 'SearchPartner', 'SearchEmailResources', \
- 'GetCountry', 'GetStates', 'FindCountryForState','CreateEmailAttachment']
+ 'GetCountry', 'GetStates', 'FindCountryForState','CreateEmailAttachment','SearchPartners']
_reg_clsctx_ = pythoncom.CLSCTX_INPROC_SERVER
_reg_clsid_ = "{C6399AFD-763A-400F-8191-7F9D0503CAE2}"
_reg_progid_ = "Python.OpenERP.XMLRpcConn"
@@ -550,3 +550,14 @@ class XMLRpcConn(object):
res['res_id'] = obj_id
id = execute(conn,'execute',self._dbname,int(self._uid),self._pwd,'ir.attachment','create',res)
return id
+
+ def SearchPartners(self):
+ res = []
+ conn = xmlrpclib.ServerProxy(self._uri+ '/xmlrpc/object')
+ obj = 'res.partner'
+ ids = execute(conn,'execute',self._dbname,int(self._uid),self._pwd,obj,'search',[])
+ recs = execute(conn,'execute',self._dbname,int(self._uid),self._pwd,obj,'read',ids,['id','name'])
+ for rec in recs:
+ name = ustr(rec['name'])
+ res.append((obj,rec['id'],name,obj))
+ return res