From 11f88c8cd4be39e0b14cd3ecb872b498c8e79b00 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?G=C3=A9ry=20Debongnie?= Date: Thu, 23 Jun 2016 09:34:49 +0200 Subject: [FIX] web, web_kanban: make qweb default dict configurable In a previous refactor, qweb configuration was simplified. However, I missed the fact that session.js sneakily configure the qweb instance after the fact. As a result, the kanban view did not have the _s key in its custom qweb instance default dict. This commit allow the qweb class constructor to add default keys to the instance. Now, kanban view can add _s, and everything is good. --- addons/web/static/src/js/framework/qweb.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'addons/web/static/src/js/framework/qweb.js') diff --git a/addons/web/static/src/js/framework/qweb.js b/addons/web/static/src/js/framework/qweb.js index 2202460a18a..39066216737 100644 --- a/addons/web/static/src/js/framework/qweb.js +++ b/addons/web/static/src/js/framework/qweb.js @@ -5,16 +5,16 @@ var translation = require('web.translation'); var _t = translation._t; -function QWeb(debug) { +function QWeb(debug, default_dict) { var qweb = new QWeb2.Engine(); - qweb.default_dict = { + qweb.default_dict = _.extend({}, default_dict || {}, { '_' : _, 'JSON': JSON, '_t' : translation._t, '__debug__': debug, 'moment': function(date) { return new moment(date); }, 'csrf_token': odoo.csrf_token, - }; + }); qweb.debug = debug; return qweb; } -- cgit v1.2.3