[FIX]: attachment type as dictionary

bzr revid: rha@tinyerp.com-20110420062646-ngijwvt2395cihuw
This commit is contained in:
Rifakat Haradwala (Open ERP)
2011-04-20 11:56:46 +05:30
parent 7ed0659f6e
commit 280e446cef
7 changed files with 19 additions and 20 deletions
+1 -1
View File
@@ -350,7 +350,7 @@ class crm_lead(crm_case, osv.osv):
res_id = self.create(cr, uid, vals, context)
attachments = msg.get('attachments', [])
attachments = msg.get('attachments', {})
self.history(cr, uid, [res_id], _('receive'), history=True,
subject = msg.get('subject'),
email = msg.get('to'),
+1 -1
View File
@@ -204,7 +204,7 @@ class crm_claim(crm.crm_case, osv.osv):
res_id = self.create(cr, uid, vals, context)
attachments = msg.get('attachments', [])
attachments = msg.get('attachments', {})
self.history(cr, uid, [res_id], _('receive'), history=True,
subject = msg.get('subject'),
email = msg.get('to'),
+1 -1
View File
@@ -128,7 +128,7 @@ class crm_helpdesk(crm.crm_case, osv.osv):
res_id = self.create(cr, uid, vals, context)
attachments = msg.get('attachments', [])
attachments = msg.get('attachments', {})
self.history(cr, uid, [res_id], _('receive'), history=True,
subject = msg.get('subject'),
email = msg.get('to'),
+1 -1
View File
@@ -329,7 +329,7 @@ class hr_applicant(crm.crm_case, osv.osv):
vals.update(res)
res_id = self.create(cr, uid, vals, context)
attachments = msg.get('attachments', [])
attachments = msg.get('attachments', {})
self.history(cr, uid, [res_id], _('receive'), history=True,
subject = msg.get('subject'),
email = msg.get('to'),
+13 -14
View File
@@ -156,7 +156,7 @@ class email_thread(osv.osv):
if context is None:
context = {}
if attach is None:
attach = []
attach = {}
model = context.get('thread_model', False)
if not model:
@@ -178,17 +178,16 @@ class email_thread(osv.osv):
for thread in threads:
attachments = []
if attach:
for fname, fcontent in attach.items():
data_attach = {
'name': fname,
'datas': binascii.b2a_base64(str(fcontent)),
'datas_fname': fname,
'description': _('Mail attachment'),
'res_model': thread._name,
'res_id': thread.id,
}
attachments.append(att_obj.create(cr, uid, data_attach))
for fname, fcontent in attach.items():
data_attach = {
'name': fname,
'datas': binascii.b2a_base64(str(fcontent)),
'datas_fname': fname,
'description': _('Mail attachment'),
'res_model': thread._name,
'res_id': thread.id,
}
attachments.append(att_obj.create(cr, uid, data_attach))
partner_id = hasattr(thread, 'partner_id') and (thread.partner_id and thread.partner_id.id or False) or False
if not partner_id and thread._name == 'res.partner':
@@ -313,8 +312,8 @@ class email_thread(osv.osv):
def create_record(msg):
if hasattr(model_pool, 'message_new'):
new_res_id = model_pool.message_new(cr, uid, msg, context=context)
if custom_values:
model_pool.write(cr, uid, [res_id], custom_values, context=context)
if custom_values:
model_pool.write(cr, uid, [new_res_id], custom_values, context=context)
return new_res_id
res_id = False
+1 -1
View File
@@ -398,7 +398,7 @@ class project_issue(crm.crm_case, osv.osv):
res_id = self.create(cr, uid, vals, context)
attachments = msg.get('attachments', [])
attachments = msg.get('attachments', {})
self.history(cr, uid, [res_id], _('receive'), history=True,
subject = msg.get('subject'),
email = msg.get('to'),
+1 -1
View File
@@ -54,7 +54,7 @@ class project_tasks(osv.osv):
data.update(res)
res_id = self.create(cr, uid, vals, context)
attachments = msg.get('attachments', [])
attachments = msg.get('attachments', {})
self.history(cr, uid, [res_id], _('receive'), history=True,
subject = msg.get('subject'),
email = msg.get('to'),