[MERGE]: Merge with lp:openobject-addons
authorrpa (Open ERP) <rpa@tinyerp.com>
Fri, 16 Apr 2010 04:50:37 +0000 (10:20 +0530)
committerrpa (Open ERP) <rpa@tinyerp.com>
Fri, 16 Apr 2010 04:50:37 +0000 (10:20 +0530)
bzr revid: rpa@tinyerp.com-20100416045037-wwe1wl1l88f1n0fm

1  2 
addons/crm/crm.py
addons/crm/wizard/crm_send_email.py

@@@ -539,14 -515,16 +519,15 @@@ class crm_case(osv.osv)
          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,
@@@ -69,8 -69,9 +69,9 @@@ class crm_send_new_email(osv.osv_memory
  
          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)