From 416f1794426af55132a19d388a2e5693f59dfde6 Mon Sep 17 00:00:00 2001 From: RomainLibert Date: Mon, 16 Sep 2019 08:24:40 +0000 Subject: [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) --- addons/web/static/src/js/views/abstract_controller.js | 3 +++ 1 file changed, 3 insertions(+) (limited to 'addons/web/static/src/js/views/abstract_controller.js') 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); -- cgit v1.2.3