← Back to team overview

credativ team mailing list archive

[Branch ~credativ/openobject-addons/6.1] Rev 7078: [FIX] Work around broken email_template code

 

------------------------------------------------------------
revno: 7078
committer: Ondřej Kuzník <ondrej.kuznik@xxxxxxxxxxxxxx>
branch nick: addons61
timestamp: Fri 2016-07-01 10:44:35 +0100
message:
  [FIX] Work around broken email_template code
modified:
  email_template/wizard/mail_compose_message.py


--
lp:~credativ/openobject-addons/6.1
https://code.launchpad.net/~credativ/openobject-addons/6.1

Your team credativ is subscribed to branch lp:~credativ/openobject-addons/6.1.
To unsubscribe from this branch go to https://code.launchpad.net/~credativ/openobject-addons/6.1/+edit-subscription
=== modified file 'email_template/wizard/mail_compose_message.py'
--- email_template/wizard/mail_compose_message.py	2015-01-21 13:33:19 +0000
+++ email_template/wizard/mail_compose_message.py	2016-07-01 09:44:35 +0000
@@ -54,9 +54,11 @@
         record_ids = []
         email_template= self.pool.get('email.template')
         model = False
-        if context.get('message_id'):
+        message_id = context.get('message_id')
+        if message_id and (isinstance(message_id, (int, long)) or \
+                (isinstance(message_id, (str, unicode)) and message_id.isdigit())):
             mail_message = self.pool.get('mail.message')
-            message_data = mail_message.browse(cr, uid, int(context.get('message_id')), context)
+            message_data = mail_message.browse(cr, uid, int(message_id), context)
             model = message_data.model
         elif context.get('mail.compose.target.model') or context.get('active_model'):
             model = context.get('mail.compose.target.model', context.get('active_model'))