I made a webkit report, but when I print it, I found in PDF some fields not show. Error:
browse_record(account. period,13)
browse_record(res.company,1)
browse_record(account.journal ,9)
How to use self.pool.get(' ') ?
My report class:
class exam_report_webkit_html(report_sxw.rml_parse): def __init__(self, cr, uid, name, context): super(exam_report_webkit_html, self).__init__(cr, uid, name, context=context) self.pool = pooler.get_pool(self.cr.dbname) self.cursor = self.cr
company_obj = self.pool.get('res.company')
company_id = company_obj._company_default_get(self.cr, uid, 'res.users', context=context)
company = company_obj.browse(self.cr, uid, company_id, context=context)
self.localcontext.update({
'time': time,
'cr':cr,
'uid': uid,
})
def print_report(self, cr, uid, ids, context=None):
# assert len(ids) == 1
period_obj=self.pool.get("account.period")
period_ids=period_obj.build_ctx_periods(self.cursor, self.uid, start_period.id, stop_period.id)
domain = [
('period_id', 'in', period_ids),
]
datas = {
'ids': period_ids,
'model': 'account.period',
'form': {}
}
return {
'type': 'ir.actions.report.xml',
'report_name': 'taskmng.report',
'datas': datas
}
report_sxw.report_sxw('report.webkitexam', 'account.move', 'addons/test/report/exam_report_webkit_html.mako', parser=exam_report_webkit_html)