diff --git a/addons/thunderbird/partner/partner.py b/addons/thunderbird/partner/partner.py index 986c9ae063d..8e1a577e9c0 100644 --- a/addons/thunderbird/partner/partner.py +++ b/addons/thunderbird/partner/partner.py @@ -79,25 +79,23 @@ class thunderbird_partner(osv.osv_memory): def update_contact(self,cr,user,vals): dictcreate = dict(vals) res_id = dictcreate.get('res_id',False) - result={} if res_id: - dictcreate.pop('res_id') address_obj = self.pool.get('res.partner.address') - address_data = address_obj.read(cr, user, int(res_id), []) - result={ 'partner_id': address_data['partner_id'] and address_data['partner_id'][0] or False, - 'country_id': dictcreate['country_id'] and int(dictcreate['country_id'][0]) or False, - 'state_id': dictcreate['state_id'] and int(dictcreate['state_id'][0]) or False, - 'name': dictcreate['name'], - 'street': dictcreate['street'], - 'street2': dictcreate['street2'], - 'zip': dictcreate['zip'], - 'city': dictcreate['city'], - 'phone': dictcreate['phone'], - 'fax': dictcreate['fax'], - 'mobile': dictcreate['mobile'], - 'email': dictcreate['email'], - } - address_obj.write(cr, user,res_id,result ) + result={ + 'partner_id': dictcreate.get('partner_id',False), + 'country_id': dictcreate.get('country_id', False), + 'state_id': dictcreate('state_id', False), + 'name': dictcreate.get('name', False), + 'street': dictcreate.get('street', False), + 'street2': dictcreate.get('street2', False), + 'zip': dictcreate.get('zip', False), + 'city': dictcreate.get('city', False), + 'phone': dictcreate.get('phone', False), + 'fax': dictcreate.get('fax', False), + 'mobile': dictcreate.get('mobile', False), + 'email': dictcreate.get('email', False), + } + address_obj.write(cr, user,res_id,result ) return True def create_partner(self,cr,user,vals): @@ -114,16 +112,6 @@ class thunderbird_partner(osv.osv_memory): search_id = self.pool.get('ir.model').search(cr, user,[('model','=',dictcreate['model'])]) return (search_id and search_id[0]) or 0 -# def thunderbird_searchcontact(self,cr,user,vals): -# address_obj = self.pool.get('res.partner.address') -# search_id1 = address_obj.search(cr,user,[('name','ilike',vals)]) -# search_id2 = address_obj.search(cr,user,[('email','=',vals)]) -# if search_id1: -# return address_obj.name_get(cr, user, search_id1) -# elif search_id2: -# return address_obj.name_get(cr, user, search_id2) -# return [] - def search_checkbox(self,cr,user,vals): if vals[0]: value = vals[0][0] @@ -172,29 +160,6 @@ class thunderbird_partner(osv.osv_memory): create_id = self.pool.get('ir.attachment').create(cr,user,dictcreate) return 0 -# def thunderbird_login(self,cr,user,vals): -# dictcreate = dict(vals) -# service = netsvc.LocalService('common') -# res = service.login(dictcreate['db'],dictcreate['login'],dictcreate['passwd']) -# return res or 0 - - def read(self, cr, user, ids, fields=None, context={}, load='_classic_read'): - ret_read = super(tinythunderbird_partner, self).read(cr, user, ids,fields,context,load) - attach_obj = self.pool.get('ir.attachment') - for read_data in ret_read: - attachments = attach_obj.search(cr,user,[('res_model','=',self._name),('res_id','=',read_data['id'])]) - attechments_data = sattach_obj.read(cr,user,attachments,['name']) - file_names = [a['name'] for a in attechments_data] - text_atteched = '\n'.join(file_names) - read_data['attachments'] = text_atteched - return ret_read - - def unlink(self, cr, uid, ids, context={}): - attach_obj = self.pool.get('ir.attachment') - attachments = attach_obj.search(cr,uid,[('res_model','=',self._name),('res_id','in',ids)]) - attach_obj.unlink(cr,uid,attachments) - return super(tinythunderbird_partner, self).unlink(cr, uid, ids,context) - def list_alldocument(self,cr,user,vals): obj_list= [('crm.lead','Lead'),('project.issue','Project Issue'), ('hr.applicant','HR Recruitment')] object=[] diff --git a/addons/thunderbird/plugin/openerp_plugin.xpi b/addons/thunderbird/plugin/openerp_plugin.xpi index 50a36b3c6e9..b65feb03d7c 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/content/config_change.xul b/addons/thunderbird/plugin/openerp_plugin/chrome/openerp_plugin/content/config_change.xul index dcda4b7b572..491a7cdae60 100644 --- a/addons/thunderbird/plugin/openerp_plugin/chrome/openerp_plugin/content/config_change.xul +++ b/addons/thunderbird/plugin/openerp_plugin/chrome/openerp_plugin/content/config_change.xul @@ -18,11 +18,7 @@ - - + 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 08c75ec0c03..4d9da9dcad9 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 @@ -1412,7 +1412,6 @@ function createContact(){ strmethod.data = 'create_contact'; var strobj = xmlRpcClient.createType(xmlRpcClient.STRING,{}); strobj.data = 'thunderbird.partner'; - var a = ['partner_id','name','street','street2','zip','city','country_id','state_id','phone','fax','mobile','email']; var b = [getPartnerId(),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 arrofarr = dictcontact(a,b); diff --git a/addons/thunderbird/plugin/openerp_plugin/chrome/openerp_plugin/locale/en-US/config_change.dtd b/addons/thunderbird/plugin/openerp_plugin/chrome/openerp_plugin/locale/en-US/config_change.dtd index a2cbcf28b0e..a926d3a980d 100644 --- a/addons/thunderbird/plugin/openerp_plugin/chrome/openerp_plugin/locale/en-US/config_change.dtd +++ b/addons/thunderbird/plugin/openerp_plugin/chrome/openerp_plugin/locale/en-US/config_change.dtd @@ -1,6 +1,5 @@ -