env = env # noqa import re report = env.ref('fusion_plating_reports.action_report_fp_bol_portrait') dlv = env['fusion.plating.delivery'].search([], order='id desc', limit=1) 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) # Pull just the SHIPPER td m = re.search(r'>SHIPPER<.*?(.*?)', out, re.S) if m: print('--- SHIPPER/CONSIGNEE table body ---') print(m.group(1)[:2500]) else: print('SHIPPER section not found, dumping first 2000 chars:') print(out[:2000])