env = env # noqa # Use the SAME path the web client uses (the cog menu) — _get_bindings. # This honours the new sequence-based sort we just added. MODELS = ['sale.order', 'account.move', 'stock.picking', 'mrp.production', 'fusion.plating.delivery', 'account.payment', 'fusion.plating.portal.job', 'fp.certificate'] Actions = env['ir.actions.actions'] Actions.clear_caches() if hasattr(Actions, 'clear_caches') else env.registry.clear_cache() for m in MODELS: bindings = Actions._get_bindings(m) reports = bindings.get('report', ()) if not reports: continue print(f'\\n=== {m} (top→bottom in Print menu) ===') for i, r in enumerate(reports, 1): # Get xmlid xmlids = env['ir.model.data'].search([ ('model', '=', 'ir.actions.report'), ('res_id', '=', r['id']) ]) xmlid = ', '.join(f'{x.module}.{x.name}' for x in xmlids) or '(no xmlid)' is_fp = 'fusion_plating' in xmlid marker = '★' if is_fp else ' ' seq = r.get('sequence', 100) print(f' {marker} {i:>2}. seq={seq:<4} {r["name"]}')