[IMP] qweb: allow recursive templates t-calls

closes #267
This commit is contained in:
Géry Debongnie
2019-09-04 16:23:44 +02:00
parent 28f7b44f9e
commit 19f0863aa3
5 changed files with 340 additions and 4 deletions
+6
View File
@@ -157,6 +157,11 @@ export class QWeb extends EventBus {
slots = {};
nextSlotId = 1;
// recursiveTemplates contains sub templates called with t-call, but which
// ends up in recursive situations. This is very similar to the slot situation,
// as in we need to propagate the scope.
recursiveFns = {};
isUpdating: boolean = false;
constructor(data?: string) {
@@ -322,6 +327,7 @@ export class QWeb extends EventBus {
const isDebug = elem.attributes.hasOwnProperty("t-debug");
const ctx = new Context(name);
if (parentContext) {
ctx.templates = Object.create(parentContext.templates);
ctx.variables = Object.create(parentContext.variables);
ctx.nextID = parentContext.parentNode! + 1;
ctx.parentNode = parentContext.parentNode!;