[ADD] QWeb2: add default dict

bzr revid: fme@openerp.com-20110907081633-vhuaf55e1dxxja2z
This commit is contained in:
Fabien Meghazi
2011-09-07 10:16:33 +02:00
parent 0fc1b42aef
commit 3908e0eb88
+4 -2
View File
@@ -201,7 +201,7 @@ QWeb2.Engine = (function() {
this.templates = {};
this.compiled_templates = {};
this.extend_templates = {};
this.dict = {};
this.default_dict = {};
this.tools = QWeb2.tools;
this.jQuery = window.jQuery;
this.reserved_words = QWeb2.RESERVED_WORDS.slice(0);
@@ -323,10 +323,12 @@ QWeb2.Engine = (function() {
" return r.join('');";
},
render : function(template, dict) {
var ndict = QWeb2.tools.extend({}, this.default_dict);
QWeb2.tools.extend(ndict, dict);
if (this.debug && window['console'] !== undefined) {
console.time("QWeb render template " + template);
}
var r = this._render(template, dict);
var r = this._render(template, ndict);
if (this.debug && window['console'] !== undefined) {
console.timeEnd("QWeb render template " + template);
}