diff --git a/addons/thunderbird/partner/partner.py b/addons/thunderbird/partner/partner.py index 593dc03b23f..33ed8443000 100644 --- a/addons/thunderbird/partner/partner.py +++ b/addons/thunderbird/partner/partner.py @@ -59,6 +59,7 @@ class thunderbird_partner(osv.osv_memory): partner = address_obj.search(cr, user,[('email','=',vals)]) res = {} res1 = {} + if not partner: res1 = { 'email': '', @@ -89,6 +90,12 @@ class thunderbird_partner(osv.osv_memory): dictcreate = dict(vals) res_id = dictcreate.get('res_id',False) result={} + + if not (dictcreate.get('partner_id')): + dictcreate.update({'partner_id': False}) + create_id = self.pool.get('res.partner.address').create(cr, user, dictcreate) + return create_id + if res_id: address_obj = self.pool.get('res.partner.address') address_data = address_obj.read(cr, user, int(res_id), []) diff --git a/addons/thunderbird/plugin/openerp_plugin.xpi b/addons/thunderbird/plugin/openerp_plugin.xpi index cb7b78ba005..cd0d271e927 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 c0d8e4c753a..ca868af8eb1 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 224dc69e655..e873c4bd98d 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 @@ -969,9 +969,9 @@ var listSearchContactHandler = { setMobilenumber(strlSearchResultValue); var t = getMobilenumber();} - if(strlSearchResult=="email" && strlSearchResultValue!=''){ + if(strlSearchResult=="email" && strlSearchResultValue!=''){ setSenderEmail(sendername); - var t = getSenderEmail();} + var t = getSenderEmail();} if(strlSearchResult=="res_id"){ setResourceId(strlSearchResultValue); @@ -1030,6 +1030,10 @@ var listSearchContactdetailHandler = { if(strlSearchResult=="email"&& strlSearchResultValue!=''){ document.getElementById("txtemail").value =strlSearchResultValue;} + if(strlSearchResult=="res_id"){ + setResourceId(strlSearchResultValue); + var t = getResourceId();} + } }, onFault: function (client, ctxt, fault) { @@ -1061,7 +1065,6 @@ function searchContactdetail() var strmethod = xmlRpcClient.createType(xmlRpcClient.STRING,{}); strmethod.data = 'search_contact'; var strname = xmlRpcClient.createType(xmlRpcClient.STRING,{}); - var t = document.getElementById("txtemail").value strname.data =document.getElementById("txtemail").value; xmlRpcClient.asyncCall(listSearchContactdetailHandler,cmbSearchList,'execute',[ strDbName,struid,strpass,strobj,strmethod,strname ],6); } @@ -1507,7 +1510,7 @@ function UpdateContact(){ var strobj = xmlRpcClient.createType(xmlRpcClient.STRING,{}); strobj.data = 'thunderbird.partner'; var a = ['res_id','partner_id','name','street','street2','zip','city','country_id','state_id','phone','fax','mobile','email']; - var b = [getResourceId(),getPartnerName(),getSenderName(),document.getElementById("txtstreet").value,document.getElementById("txtstreet2").value,document.getElementById("txtzip").value, document.getElementById("txtcity").value,document.getElementById("country").value,document.getElementById("state").value,document.getElementById("txtoffice").value,document.getElementById("txtfax").value,document.getElementById("txtmobile").value,getSenderEmail()]; + var b = [getResourceId(),getPartnerName(),document.getElementById("txtcontactname").value,document.getElementById("txtstreet").value,document.getElementById("txtstreet2").value,document.getElementById("txtzip").value, document.getElementById("txtcity").value,document.getElementById("country").value,document.getElementById("state").value,document.getElementById("txtoffice").value,document.getElementById("txtfax").value,document.getElementById("txtmobile").value,document.getElementById("txtemail").value]; var arrofarr = dictcontact(a,b); xmlRpcClient.asyncCall(listUpdateContactHandler,null,'execute',[strDbName,struids,strpass,strobj,strmethod,arrofarr],6); }