I have two values start_date and end_date that I want to access in the qweb template. How can I these values in the qweb.?
I am generating and then sending it to email. Here's how I am creating a 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, the last argument is for passing the context to the reports. Pass your variables like 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 then in qweb access them as,
<t t-esc="docs._context['start_date']"></t>
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With