for case in cases:
model_ids = model_obj.search(cr, uid, [('model', '=', case._name)])
data = {
- 'name': keyword,
- 'user_id': uid,
- 'date': time.strftime('%Y-%m-%d %H:%M:%S'),
- 'model_id' : model_ids and model_ids[0] or False,
- 'res_id': case.id,
- 'section_id': case.section_id.id
+ 'name': keyword,
+ 'user_id': uid,
+ 'date': time.strftime('%Y-%m-%d %H:%M:%S'),
+ 'model_id' : model_ids and model_ids[0] or False,
+ 'res_id': case.id,
+ 'section_id': case.section_id.id,
+ 'message_id':message_id
}
- obj = self.pool.get('crm.case.log')
if history:
obj = self.pool.get('crm.case.history')
data['description'] = details or case.description
data['email_from'] = email_from or \
(case.section_id and case.section_id.reply_to) or \
(case.user_id and case.user_id.address_id and \
- case.user_id.address_id.email) or tools.config.get('email_from',False)
+ case.user_id.address_id.email) or tools.config.get('email_from', False)
res = obj.create(cr, uid, data, context)
return True
+
_history = __history
+ history = __history
def create(self, cr, uid, *args, **argv):
-
- """
+ """Overrides orm create method
@param self: The object pointer
@param cr: the current row, from the database cursor,
@param uid: the current user’s ID for security checks,
for data in self.read(cr, uid, ids, context=context):
attach = filter(lambda x: x, [data['doc1'], data['doc2'], data['doc3']])
- attach = map(lambda x: x and ('Attachment'+str(attach.index(x)+1), base64.decodestring(x)), attach)
-
+ attach = map(lambda x: (data['doc' + str(attach.index(x) + 1) \
+ + '_fname'], base64.decodestring(x)), attach)
+ message_id = None
if context.get('mail', 'new') == 'new':
case = case_pool.browse(cr, uid, res_id)