[FIX] email_template: fixed default_get, not possible ot render when we do not have any data about the record used for rendering

bzr revid: tde@openerp.com-20131217165931-muxsi0hwhihcvo1f
This commit is contained in:
Thibault Delavallée 2013-12-17 17:59:31 +01:00
parent e701544aa4
commit ba73588c6c
1 changed files with 1 additions and 1 deletions

View File

@ -46,7 +46,7 @@ class mail_compose_message(osv.TransientModel):
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'):
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'),