summaryrefslogtreecommitdiff
path: root/addons/web/static/src/js
diff options
context:
space:
mode:
authorRomainLibert <rli@odoo.com>2019-09-16 08:24:40 +0000
committerRomainLibert <rli@odoo.com>2019-09-16 15:03:35 +0000
commit416f1794426af55132a19d388a2e5693f59dfde6 (patch)
treebc9c1cfcc2b06263f98fc2e9277d931151220df6 /addons/web/static/src/js
parent3198705e301ab3e49d7db3adbd174fde806b0b59 (diff)
[FIX] web: pass the context when executing an action
In case you have a button of type action, the controller is doing an rpc on the model using the right method, but in this rpc, the context is not passed. This creates a translation problem (nothing is translated) since the language is not defined in the context. Task Id 2062419 Closes #36189 closes odoo/odoo#36969 Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
Diffstat (limited to 'addons/web/static/src/js')
-rw-r--r--addons/web/static/src/js/views/abstract_controller.js3
1 files changed, 3 insertions, 0 deletions
diff --git a/addons/web/static/src/js/views/abstract_controller.js b/addons/web/static/src/js/views/abstract_controller.js
index 63d59d153fd..5b5197469db 100644
--- a/addons/web/static/src/js/views/abstract_controller.js
+++ b/addons/web/static/src/js/views/abstract_controller.js
@@ -19,6 +19,8 @@ var config = require('web.config');
var core = require('web.core');
var mvc = require('web.mvc');
+var session = require('web.session');
+
var QWeb = core.qweb;
var AbstractController = mvc.Controller.extend(ActionMixin, {
@@ -476,6 +478,7 @@ var AbstractController = mvc.Controller.extend(ActionMixin, {
this.dp.add(this._rpc({
model: data.model,
method: data.method,
+ context: session.user_context,
})).then(function (action) {
if (action !== undefined) {
self.do_action(action, options);