summaryrefslogtreecommitdiff
path: root/addons/mail/wizard/mail_compose_message.py
diff options
context:
space:
mode:
authorChristophe Simonis <chs@odoo.com>2016-12-16 15:55:13 +0100
committerChristophe Simonis <chs@odoo.com>2016-12-16 15:55:13 +0100
commit2a6e077f4a9ab2b361ba81ea0bc9d7a5badd2e3d (patch)
tree54383a1726119d64a7a2097ca1d007b14f910237 /addons/mail/wizard/mail_compose_message.py
parent68171347967dcaf2fa299bcd7f27915e03b80cc8 (diff)
parent1246a470df5b8dee2845ebe8639076d2a715c341 (diff)
[MERGE] forward port branch 9.0 up to 1246a470df5
Diffstat (limited to 'addons/mail/wizard/mail_compose_message.py')
-rw-r--r--addons/mail/wizard/mail_compose_message.py13
1 files changed, 6 insertions, 7 deletions
diff --git a/addons/mail/wizard/mail_compose_message.py b/addons/mail/wizard/mail_compose_message.py
index 176ea88aec1..f55854a704e 100644
--- a/addons/mail/wizard/mail_compose_message.py
+++ b/addons/mail/wizard/mail_compose_message.py
@@ -12,18 +12,17 @@ from openerp.tools.safe_eval import safe_eval as eval
EXPRESSION_PATTERN = re.compile('(\$\{.+?\})')
-def _reopen(self, res_id, model):
+def _reopen(self, res_id, model, context=None):
+ # save original model in context, because selecting the list of available
+ # templates requires a model in context
+ context = dict(context or {}, default_model=model)
return {'type': 'ir.actions.act_window',
'view_mode': 'form',
'view_type': 'form',
'res_id': res_id,
'res_model': self._name,
'target': 'new',
- # save original model in context, because selecting the list of available
- # templates requires a model in context
- 'context': {
- 'default_model': model,
- },
+ 'context': context,
}
@@ -409,7 +408,7 @@ class MailComposer(models.TransientModel):
# generate the saved template
record.write({'template_id': template.id})
record.onchange_template_id_wrapper()
- return _reopen(self, record.id, record.model)
+ return _reopen(self, record.id, record.model, context=self._context)
#------------------------------------------------------
# Template rendering