Community mailing list archives

Re: variable is not reachable

Shivam Goyal
- 09/28/2015 11:53:50
k see the following example :

XML :-
<template  id = "my_template">
<p> Hello, <t t-esc = "name"/> </p> 

py file -: (rendering the above xml)


Since we passes "name" as a key in the dictionary hence it is directly available as a variable in the template.
This example was taken for a website module. However if you are working on a report then you have to do the following

py file -:

def printing _report_method(cr,uid,ids,context=None)

data = {


return {
                        'type': '',
                        'report_name': '',
                        'datas': {'model':'model.model','data':data}


<t t-foreach="data['partners']" t-as = "any_variable">
     <span><t t-esc = "any_variable['name']"</t></span>

I hope this helps

On Mon, Sep 28, 2015 at 9:08 PM, Khalid Saeed <> wrote:
@Mohamed Magdy

That would be considered as evaluating string 'partner' not the variable

@​Shivam Goyal
I am sorry I don't know how to pass the partner variable as you suggested.

Post to: