From 4718957b432727f22d170116feb2f4ce420a1407 Mon Sep 17 00:00:00 2001 From: "Atul Patel (OpenERP)" Date: Mon, 31 Jan 2011 11:04:47 +0530 Subject: [PATCH 1/2] [FIX]: Correction on creating attachment in mail_gateway for bug 705439 bzr revid: atp@tinyerp.com-20110131053447-99ztqu5tyzn7mlce --- addons/mail_gateway/mail_gateway.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/addons/mail_gateway/mail_gateway.py b/addons/mail_gateway/mail_gateway.py index 15c5bba7c64..156586c2edd 100644 --- a/addons/mail_gateway/mail_gateway.py +++ b/addons/mail_gateway/mail_gateway.py @@ -128,7 +128,7 @@ class mailgate_thread(osv.osv): for case in cases: attachments = [] for att in attach: - attachments.append(att_obj.create(cr, uid, {'name': att[0], 'datas': base64.encodestring(att[1])})) + attachments.append(att_obj.create(cr, uid, {'res_model':case._name,'res_id':case.id, 'name': att[0], 'datas': base64.encodestring(att[1])})) partner_id = hasattr(case, 'partner_id') and (case.partner_id and case.partner_id.id or False) or False if not partner_id and case._name == 'res.partner': @@ -220,11 +220,12 @@ class mailgate_message(osv.osv): action_data = False action_pool = self.pool.get('ir.actions.act_window') message_pool = self.browse(cr ,uid, ids, context=context)[0] + att_ids = [x.id for x in message_pool.attachment_ids] action_ids = action_pool.search(cr, uid, [('res_model', '=', 'ir.attachment')]) if action_ids: action_data = action_pool.read(cr, uid, action_ids[0], context=context) action_data.update({ - 'domain': [('res_id','=',message_pool.res_id),('res_model','=',message_pool.model)], + 'domain': [('id','in',att_ids)], 'nodestroy': True }) return action_data From 3147efbd8febea635a3a50feae0ac4ff3817e245 Mon Sep 17 00:00:00 2001 From: "Atul Patel (OpenERP)" Date: Mon, 31 Jan 2011 14:14:19 +0530 Subject: [PATCH 2/2] [IMP]: Minor Improvement just changed icon. bzr revid: atp@tinyerp.com-20110131084419-pluxe4iiqgkpwn2u --- addons/crm/wizard/crm_send_email_view.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/addons/crm/wizard/crm_send_email_view.xml b/addons/crm/wizard/crm_send_email_view.xml index ebbb72592f2..e973eb477c9 100644 --- a/addons/crm/wizard/crm_send_email_view.xml +++ b/addons/crm/wizard/crm_send_email_view.xml @@ -37,7 +37,7 @@ -