# Render BoL HTML body to see the real error import traceback env = env # noqa report = env.ref('fusion_plating_reports.action_report_fp_bol_portrait') dlv = env['fusion.plating.delivery'].search([], order='id desc', limit=1) print('rendering HTML for:', dlv.name, 'id=', dlv.id) try: html, _ = report.with_context(force_report_rendering=True )._render_qweb_html(report.report_name, [dlv.id]) out = html.decode() if isinstance(html, bytes) else str(html) print('HTML length:', len(out)) # Show beginning + look for Traceback markers if 'Traceback' in out or 'Oops' in out: idx = max(out.find('Traceback'), out.find('Oops')) print('--- ERROR SECTION ---') print(out[idx:idx+3000]) else: print('--- FIRST 800 CHARS ---') print(out[:800]) except Exception: print('--- DIRECT EXCEPTION ---') traceback.print_exc()