Skip to content

Commit

Permalink
[FIX] email_template: updated onchange_template_id when not having
Browse files Browse the repository at this point in the history
a template defined: some values were missing leadins to wrong partners and
subject pre computation.
  • Loading branch information
tde-banana-odoo committed Feb 5, 2015
1 parent d5a50fd commit ba9bc1e
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions addons/email_template/wizard/mail_compose_message.py
Original file line number Diff line number Diff line change
Expand Up @@ -116,8 +116,8 @@ def onchange_template_id(self, cr, uid, ids, template_id, composition_mode, mode
values.setdefault('attachment_ids', list()).append(ir_attach_obj.create(cr, uid, data_attach, context=context))
else:
default_context = dict(context, default_composition_mode=composition_mode, default_model=model, default_res_id=res_id)
default_values = self.default_get(cr, uid, ['composition_mode', 'model', 'res_id', 'subject', 'body', 'email_from', 'reply_to', 'attachment_ids', 'mail_server_id'], context=default_context)
values = dict((key, default_values[key]) for key in ['subject', 'body', 'email_from', 'reply_to', 'attachment_ids', 'mail_server_id'] if key in default_values)
default_values = self.default_get(cr, uid, ['composition_mode', 'model', 'res_id', 'parent_id', 'partner_ids', 'subject', 'body', 'email_from', 'reply_to', 'attachment_ids', 'mail_server_id'], context=default_context)
values = dict((key, default_values[key]) for key in ['subject', 'body', 'partner_ids', 'email_from', 'reply_to', 'attachment_ids', 'mail_server_id'] if key in default_values)

if values.get('body_html'):
values['body'] = values.pop('body_html')
Expand Down

0 comments on commit ba9bc1e

Please sign in to comment.