openerp - How can I pass values to the context of qweb reports that will be accessed on the template -


i have 2 values start_date , end_date want access in qweb template. how can these values in qweb.?

i generating , sending email. here's how creating report.

job_id = self.pool.get('module.report_name').search(self.env.cr, self.env.uid, [('date', '>=', start),('date', '<=', end)], context=none)  data, format = openerp.report.render_report(self.env.cr,self.env.uid, job_id, report.report_name, {}, {}) 

while rendering report, last argument passing context reports. pass variables that,

data, format = openerp.report.render_report(self.env.cr,self.env.uid, job_id, report.report_name, {}, {'start_date': start_date, 'end_date': end_date}) 

and in qweb access them as,

<t t-esc="docs._context['start_date']"></t> 

Comments

Popular posts from this blog

How to check data type in C++? -

javascript - Is getTimezoneOffset() stable during daylight saving transition? -

sql server - SQL Query returns one result, does not return 0 or NULL result -