diff options
| author | Paramjit Singh Sahota <psa@tinyerp.com> | 2013-12-24 11:01:25 +0530 |
|---|---|---|
| committer | Paramjit Singh Sahota <psa@tinyerp.com> | 2013-12-24 11:01:25 +0530 |
| commit | 18d8368ee11eef0a74bacdb8f293414331bfa8da (patch) | |
| tree | fc21df70cbd2901396c2bcf2fee0b52d750abd43 /addons/email_template/wizard/mail_compose_message.py | |
| parent | 5900672160c2bd5ae1d9257f20dbb5c51a193996 (diff) | |
| parent | 123185757f51ee7e146d7295864556999d2a6938 (diff) | |
[MERGE] Merged lp:~openerp-dev/openobject-addons/trunk-website-al
bzr revid: psa@tinyerp.com-20131224053125-3lrogsrgd3ccp0i6
Diffstat (limited to 'addons/email_template/wizard/mail_compose_message.py')
| -rw-r--r-- | addons/email_template/wizard/mail_compose_message.py | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/addons/email_template/wizard/mail_compose_message.py b/addons/email_template/wizard/mail_compose_message.py index bae7a0d8f9c..db6485d19ae 100644 --- a/addons/email_template/wizard/mail_compose_message.py +++ b/addons/email_template/wizard/mail_compose_message.py @@ -41,6 +41,20 @@ def _reopen(self, res_id, model): class mail_compose_message(osv.TransientModel): _inherit = 'mail.compose.message' + def default_get(self, cr, uid, fields, context=None): + """ Override to pre-fill the data when having a template in single-email mode """ + if context is None: + context = {} + res = super(mail_compose_message, self).default_get(cr, uid, fields, context=context) + if res.get('composition_mode') != 'mass_mail' and context.get('default_template_id') and res.get('model') and res.get('res_id'): + res.update( + self.onchange_template_id( + cr, uid, [], context['default_template_id'], res.get('composition_mode'), + res.get('model'), res.get('res_id'), context=context + )['value'] + ) + return res + _columns = { 'template_id': fields.many2one('email.template', 'Use template', select=True), 'partner_to': fields.char('To (Partner IDs)', |
