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

java - Run spring boot application error: Cannot instantiate interface org.springframework.context.ApplicationListener -

reactjs - React router and this.props.children - how to pass state to this.props.children -

Excel VBA "Microsoft Windows Common Controls 6.0 (SP6)" Location Changes -