[FIX] qweb: allow t-call on arbitrary html nodes

This is a rarely (if ever) used feature, but according to our qweb
reference implementation, it is possible to use the
t-call directive on an arbitrary html tag, like this:

<div t-call="my.template"/>

It is then interpreted as:

<div><t t-call="my.template"/></div>

So, with this commit, we make sure that the owl qweb implementation
matches that behaviour.

closes #706
This commit is contained in:
Géry Debongnie
2020-09-17 16:06:54 +02:00
committed by aab-odoo
parent b2db7f21ed
commit e032314739
5 changed files with 88 additions and 7 deletions
@@ -1732,6 +1732,24 @@ exports[`t-call (template calling scoped parameters 1`] = `
}"
`;
exports[`t-call (template calling t-call allowed on a non t node 1`] = `
"function anonymous(context, extra
) {
// Template name: \\"caller\\"
let utils = this.constructor.utils;
let scope = Object.create(context);
let h = this.h;
let c1 = [], p1 = {key:1};
let vn1 = h('div', p1, c1);
let _origScope3 = scope;
scope = Object.create(scope);
scope.__access_mode__ = 'ro';
this.constructor.subTemplates['1'].call(this, scope, Object.assign({}, extra, {parentNode: c1, parent: utils.getComponent(context), key: '__4__'}));
scope = _origScope3;
return vn1;
}"
`;
exports[`t-call (template calling t-call with t-if 1`] = `
"function anonymous(context, extra
) {