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
Post a Comment