[FIX] qweb: wrong result when use the value defined by the t-set
When use t-set the value is replaced by an empty list and can't be use inside the t-set. Issue: <t t-set="bibi"><t t-raw="bibi"/> other</t> => ["\n "] other
This commit is contained in:
@@ -891,18 +891,16 @@ class QWeb(object):
|
||||
if body:
|
||||
def_name = self._create_def(options, body, prefix='set', lineno=el.sourceline)
|
||||
return [
|
||||
# $varset = []
|
||||
# content = []
|
||||
ast.Assign(
|
||||
targets=[
|
||||
self._values_var(ast.Str(varname), ctx=ast.Store())
|
||||
],
|
||||
targets=[ast.Name(id='content', ctx=ast.Store())],
|
||||
value=ast.List(elts=[], ctx=ast.Load())
|
||||
),
|
||||
# set(self, $varset.append)
|
||||
ast.Expr(self._call_def(
|
||||
def_name,
|
||||
append=ast.Attribute(
|
||||
value=self._values_var(ast.Str(varname), ctx=ast.Load()),
|
||||
value=ast.Name(id='content', ctx=ast.Load()),
|
||||
attr='append',
|
||||
ctx=ast.Load()
|
||||
)
|
||||
@@ -912,7 +910,7 @@ class QWeb(object):
|
||||
targets=[self._values_var(ast.Str(varname), ctx=ast.Store())],
|
||||
value=ast.Call(
|
||||
func=ast.Attribute(value=ast.Str(u''), attr='join', ctx=ast.Load()),
|
||||
args=[self._values_var(ast.Str(varname), ctx=ast.Load())], keywords=[],
|
||||
args=[ast.Name(id='content', ctx=ast.Load())], keywords=[],
|
||||
starargs=None, kwargs=None
|
||||
)
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user