diff --git a/addons/thunderbird/partner/partner.py b/addons/thunderbird/partner/partner.py index 659e826d529..d0c830bfa8b 100644 --- a/addons/thunderbird/partner/partner.py +++ b/addons/thunderbird/partner/partner.py @@ -166,12 +166,13 @@ class thunderbird_partner(osv.osv_memory): msg_new = dictcreate.get('message') ref = ref_id.split(',') model = ref[0] - model_obj = self.pool.get(model) - model_data = model_obj.search(cr, uid,[('name', 'ilike', ref[1])]) - if model_data: - res_id = int(model_data[0]) - server_tools_pool.history_message(cr, uid, model, res_id, msg_new) - res_ids.append(res_id) + res_id = int(ref[1]) + if message_id: + msg_ids = msg_pool.search(cr, uid, [('message_id','=',message_id),('res_id','=',res_id),('model','=',model)]) + if msg_ids and len(msg_ids): + continue + server_tools_pool.history_message(cr, uid, model, res_id, msg_new) + res_ids.append(res_id) return len(res_ids) def process_email(self, cr, uid, vals): diff --git a/addons/thunderbird/plugin/openerp_plugin.xpi b/addons/thunderbird/plugin/openerp_plugin.xpi index 165781bb579..70e1f8fcaa0 100644 Binary files a/addons/thunderbird/plugin/openerp_plugin.xpi and b/addons/thunderbird/plugin/openerp_plugin.xpi differ diff --git a/addons/thunderbird/plugin/openerp_plugin/chrome/openerp_plugin.jar b/addons/thunderbird/plugin/openerp_plugin/chrome/openerp_plugin.jar index 4afd40519d7..aeab9c82228 100644 Binary files a/addons/thunderbird/plugin/openerp_plugin/chrome/openerp_plugin.jar and b/addons/thunderbird/plugin/openerp_plugin/chrome/openerp_plugin.jar differ diff --git a/addons/thunderbird/plugin/openerp_plugin/chrome/openerp_plugin/content/tiny_xmlrpc.js b/addons/thunderbird/plugin/openerp_plugin/chrome/openerp_plugin/content/tiny_xmlrpc.js index 77b3ba8598a..fadc29222fe 100755 --- a/addons/thunderbird/plugin/openerp_plugin/chrome/openerp_plugin/content/tiny_xmlrpc.js +++ b/addons/thunderbird/plugin/openerp_plugin/chrome/openerp_plugin/content/tiny_xmlrpc.js @@ -1220,7 +1220,7 @@ var listSearchCheckboxHandler = { listcell.setAttribute("height",12); listcell.setAttribute("label",arrFinalList[i][j][1]); //stores the name ofthe record listItem.appendChild(listcell); - listItem.value = arrFinalList[i][j][1]; //stores the name of the record + listItem.value = arrFinalList[i][j][0]; //stores the id of the record listItem.label = arr1[i]; // stores the value of the object cmbSearchList.appendChild(listItem); } @@ -1399,13 +1399,13 @@ var listArchiveHandler = { } else if (createId<0) { - alert("sorry Mail is not Archived to" +" " + ":" + " "+ list_documents.value); + alert("sorry Mail is not Archived"); } else if (createId>=1) { - alert("Mail Archived Successfully to" +" " + ":" + " "+ list_documents.value); + alert("Mail Archived Successfully"); } window.close(); @@ -1491,6 +1491,24 @@ function upload_archivemail() } +var listArchiveDocumentHandler = { + onResult: function(client, context, result) { + netscape.security.PrivilegeManager.enablePrivilege('UniversalXPConnect UniversalBrowserAccess'); + var createId = result.QueryInterface(Components.interfaces.nsISupportsPRInt32); + var popup = document.getElementById("section").selectedItem; + alert("Document Created Successfully For " +" " + ":" + " "+ popup.label); + window.close(); + + }, + onFault: function (client, ctxt, fault) { + + }, + + onError: function (client, ctxt, status, errorMsg) { + + } +} + function create_archivemail(){ var popup = document.getElementById("section").selectedItem; // a element @@ -1517,10 +1535,10 @@ function create_archivemail(){ var a = ['model', 'message']; var b = [object, eml_string]; var arrofarr = dictcontact(a,b); - xmlRpcClient.asyncCall(listArchiveHandler,null,'execute',[strDbName,struids,strpass,strobj,strmethod,arrofarr],6); - alert("Document Created Successfully For " +" " + ":" + " "+ popup.label); + xmlRpcClient.asyncCall(listArchiveDocumentHandler,null,'execute',[strDbName,struids,strpass,strobj,strmethod,arrofarr],6); + //alert("Document Created Successfully For " +" " + ":" + " "+ popup.label); } - window.close(); + //window.close(); } else {