From ffe0db0dd1551c2527d80e185d1d70e8e540b0e8 Mon Sep 17 00:00:00 2001 From: Nicolas Martinelli Date: Mon, 20 Jun 2016 15:28:38 +0200 Subject: [PATCH] [FIX] mail: mail template in Discuss When the mail composer is opened thanks to the "Send Mail" button in Discuss, it's possible to save a mail template, but the user can't access it anymore later on. This is because the field `model` is by default empty in this specific case since this is a client action. However, when saving the template, the default value 'mail.template' is used for the `model` field. Therefore the domain on the `template_id` field prevents the user to find back the model he just saved. The fix sends the `active_model` in the context with the value 'mail.message', so that the `default_get` method of `mail.compose.message` will set the appropriate default value. opw-677936 --- addons/mail/static/src/js/client_action.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/mail/static/src/js/client_action.js b/addons/mail/static/src/js/client_action.js index 0e27eb10fbb..36bd812f1c0 100644 --- a/addons/mail/static/src/js/client_action.js +++ b/addons/mail/static/src/js/client_action.js @@ -647,7 +647,7 @@ var ChatAction = Widget.extend(ControlPanelMixin, { view_type: 'form', views: [[false, 'form']], target: 'new', - context: "{'default_no_auto_thread': False}", + context: "{'default_no_auto_thread': False, 'active_model': 'mail.message'}", }); }, });