tfr (Openerp) has proposed merging 
lp:~openerp-dev/openobject-addons/trunk-fix-email_template-tfr into 
lp:openobject-addons.

Requested reviews:
  OpenERP Core Team (openerp)

For more details, see:
https://code.launchpad.net/~openerp-dev/openobject-addons/trunk-fix-email_template-tfr/+merge/89431

Fix auto fill the mail compose form
-- 
https://code.launchpad.net/~openerp-dev/openobject-addons/trunk-fix-email_template-tfr/+merge/89431
Your team OpenERP R&D Team is subscribed to branch 
lp:~openerp-dev/openobject-addons/trunk-fix-email_template-tfr.
=== modified file 'email_template/email_template.py'
--- email_template/email_template.py	2011-12-31 07:57:20 +0000
+++ email_template/email_template.py	2012-01-20 13:16:40 +0000
@@ -186,7 +186,7 @@
                  'res_model': 'mail.compose.message',
                  'src_model': src_obj,
                  'view_type': 'form',
-                 'context': "{'mail.compose.message.mode':'mass_mail'}",
+                 'context': "{'mail.compose.message.mode':'mass_mail', 'mail.compose.template_id' : %d}" % (template.id),
                  'view_mode':'form,tree',
                  'view_id': res_id,
                  'target': 'new',

=== modified file 'email_template/wizard/mail_compose_message.py'
--- email_template/wizard/mail_compose_message.py	2012-01-18 16:22:03 +0000
+++ email_template/wizard/mail_compose_message.py	2012-01-20 13:16:40 +0000
@@ -69,6 +69,10 @@
                                         size=-1 # means we want an int db column
                                         ),
     }
+    
+    _defaults = {
+        'template_id' : lambda self, cr, uid, context={} : context.get('mail.compose.template_id', False)          
+    }
 
     def on_change_template(self, cr, uid, ids, use_template, template_id, email_from=None, email_to=None, context=None):
         if context is None:

_______________________________________________
Mailing list: https://launchpad.net/~openerp-dev-gtk
Post to     : [email protected]
Unsubscribe : https://launchpad.net/~openerp-dev-gtk
More help   : https://help.launchpad.net/ListHelp

Reply via email to