summaryrefslogtreecommitdiff
path: root/addons/website/static/src
diff options
context:
space:
mode:
authorXavier Morel <xmo@odoo.com>2018-10-31 10:42:06 +0000
committerXavier Morel <xmo@odoo.com>2019-01-29 10:22:17 +0000
commit42fbee83ad2f3f33188cf27a1449b8875c2d8a2a (patch)
treec607de0f5bdaba2a246650ff96499d6eab3edac7 /addons/website/static/src
parentbf4a8b3de81783cf2da1145a618e97c18f780719 (diff)
[IMP] qweb: stop requiring t-name-flagged sub-node
QWeb's rendering currently *requires* that when loading a document instead of rendering the document itself it will render a sub-node with a properly labeled t-name. If a view is invoked by id, ir.qweb will look for a child with a t-name and fix up that t-name such that the base qweb object will find and render it. This feature mostly exists for JS compatibility (because a single document can contain multiple cross-linkable templates, and it was useful for cross-implementation tests though I'm not sue they're even checked anymore), and the <template> tag kinda took care of it, however with a more proper qweb view it becomes more of a liability / pain in the ass. Note: turns out there are bits of javascript which read server templates (???) and need to be altered to correctly handle the lack of <templates> wrapping.
Diffstat (limited to 'addons/website/static/src')
-rw-r--r--addons/website/static/src/js/widgets/theme.js3
1 files changed, 3 insertions, 0 deletions
diff --git a/addons/website/static/src/js/widgets/theme.js b/addons/website/static/src/js/widgets/theme.js
index 7a3ef777232..de771132784 100644
--- a/addons/website/static/src/js/widgets/theme.js
+++ b/addons/website/static/src/js/widgets/theme.js
@@ -45,6 +45,9 @@ var ThemeCustomizeDialog = Dialog.extend({
method: 'read_template',
args: ['website.theme_customize'],
}).then(function (data) {
+ if (!/^<templates>/.test(data)) {
+ data = _.str.sprintf('<templates>%s</templates>', data);
+ }
return core.qweb.add_template(data);
});
}