From 7b74046200cdcbd5e04de2c55cda6ab6ccc42f6d Mon Sep 17 00:00:00 2001 From: Nicolas Martinelli Date: Fri, 10 Feb 2017 14:44:20 +0100 Subject: [PATCH] [FIX] mail: action button translation - Install a language other than English, set it to your user. - On any model, send a message (the recipient should be a user, not a simple portal user). - The recipient receives a notification with a primary button half translated, for example "Vue Task". When the call is performed to method `message_post`, the sessioon context is not added to the RPC request. Therefore, when the model name is read (method `_message_notification_recipients`), it is done in the default language. Note that this is the case for any RPC request using the `call` JS function. opw-707678 --- addons/mail/static/src/js/chatter.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/addons/mail/static/src/js/chatter.js b/addons/mail/static/src/js/chatter.js index 8291237a2de..f792af910ff 100644 --- a/addons/mail/static/src/js/chatter.js +++ b/addons/mail/static/src/js/chatter.js @@ -10,6 +10,7 @@ var config = require('web.config'); var core = require('web.core'); var form_common = require('web.form_common'); var framework = require('web.framework'); +var pyeval = require('web.pyeval'); var web_utils = require('web.utils'); var _t = core._t; @@ -452,10 +453,13 @@ var Chatter = form_common.AbstractField.extend({ _render_value: function () { // update context + var context = _.extend(this.options.context || {}, + pyeval.eval('contexts', this.build_context()) + ); this.context = _.extend({ default_res_id: this.view.datarecord.id || false, default_model: this.view.model || false, - }, this.options.context || {}); + }, context); this.thread_dataset = this.view.dataset; this.res_id = this.view.datarecord.id; this.record_name = this.view.datarecord.display_name;