[FIX] crm, mail_gateway: fixes send reminder.
authorJMA(OpenERP) <>
Wed, 28 Jul 2010 10:08:30 +0000 (15:38 +0530)
committervra <vra@tinyerp.com>
Wed, 28 Jul 2010 10:08:30 +0000 (15:38 +0530)
bzr revid: vra@tinyerp.com-20100728100830-9d3kpm45e7ghn3n6

addons/crm/crm.py
addons/mail_gateway/mail_gateway.py

index 2db380f..2cabefd 100644 (file)
@@ -376,7 +376,10 @@ class crm_case(object):
                 if not destination:
                     src, dest = dest, src
                     if body and case.user_id.signature:
-                        body += '\n\n%s' % (case.user_id.signature)
+                        if body:
+                            body += '\n\n%s' % (case.user_id.signature)
+                        else:
+                            body = '\n\n%s' % (case.user_id.signature)
 
                 body = self.format_body(body)
 
index a595b4b..ef36be3 100644 (file)
@@ -159,7 +159,8 @@ class mailgate_message(osv.osv):
             msg_txt = ''
             if message.history:
                 msg_txt += (message.email_from or '/') + ' wrote on ' + format_date_tz(message.date, tz) + ':\n\t'
-                msg_txt += '\n\t'.join(message.description.split('\n')[:3]) + '...'
+                if message.description:
+                    msg_txt += '\n\t'.join(message.description.split('\n')[:3]) + '...'
             else:
                 msg_txt = (message.user_id.name or '/') + '  on ' + format_date_tz(message.date, tz) + ':\n\t'
                 if message.name == 'Opportunity':