From 621a7c92b0b3e92091c4e6ab4cde58bc5e6af789 Mon Sep 17 00:00:00 2001 From: Christophe Matthieu Date: Mon, 29 Aug 2016 10:31:46 +0200 Subject: [PATCH] [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: other => ["\n "] other --- openerp/addons/base/ir/ir_qweb/qweb.py | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/openerp/addons/base/ir/ir_qweb/qweb.py b/openerp/addons/base/ir/ir_qweb/qweb.py index dbffde9f1e9..b414da72113 100644 --- a/openerp/addons/base/ir/ir_qweb/qweb.py +++ b/openerp/addons/base/ir/ir_qweb/qweb.py @@ -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 ) )