OdooWiki OCA HUB

Report to printer via WebSocket

base_report_to_printer_websocket folder_open OCA/report-print-send open_in_new
Generic Modules/Base License: AGPL-3

This module extends base_report_to_printer to send print jobs through the Odoo Bus (WebSocket) instead of a traditional print server like CUPS.

When a report is printed, the module encodes the rendered PDF in Base64 and sends a print_job message through the bus to the user configured on the printer. A client-side listener running as that user receives the payload and forwards it to the local printer.

Main features:

  • No external print server required — works over the existing Odoo Bus.
  • Sends print jobs as Base64-encoded PDFs via WebSocket.
  • Each printer is bound to a specific Odoo user, so jobs are delivered only to the right client-side agent.
  • Compatible with the standard base_report_to_printer configuration (global, per user, per report, per user + report).
  • Works with odoo-print-client as the client-side agent to receive and print jobs.

auto_awesome What this module does

AI-generated from the code · Odoo 19.0

Lets Odoo send report print jobs directly to a user's computer over the existing WebSocket connection, without needing an external print server. Each printer is linked to a specific user who receives the job.

This module adds a new printing option to the printer configuration screen. On a printer record, users can choose "WebSocket" as the backend and then select the Odoo user who should receive the print jobs. The user field only appears and is required when the WebSocket backend is selected.

When a report is printed to a printer configured this way, Odoo renders the PDF, encodes it, and sends it as a "print_job" message through the Odoo bus (the same real-time channel used for notifications). Only the user assigned to that printer is subscribed to receive it, so jobs go to the right person's machine.

On the client side, a small listener running as that user picks up the message and forwards the PDF to the local printer. After a successful send, the user sees a confirmation message saying the print job was sent via WebSocket; if it fails, an error notification appears instead.

It works alongside the standard report-to-printer setup, so the usual choices (global, per user, per report, or per user and report) still apply. It touches the printing.printer model and the bus channel logic, and adds a field to the printer form view.

Models and fields (1)
  • printing.printer · extends an existing modelbackend, websocket_user_id

Text generated by AI (DeepSeek) from reading the Odoo 19.0 code on GitHub; it may contain mistakes, so check the code before deciding. View the code on GitHub

Availability by version

Reviewed: 2026-11-03
Confirmed (verified in repository and branch) Estimated (unverified) No information

Confirmation status: 1 confirmed, 8 with no information of 9 versions.

Sources · Odoo 19.0

Confirmed on 2026-11-03 in branch 19.0 of OCA/report-print-send.

terminal Installation and usage

OCA documentation · Odoo 19.0
  • Create a printer record in Settings > Printing > Printers with the backend set to WebSocket.
  • Set the System Name to the name of the target printer as known by the client-side listener (e.g. MFC-L3750CDW). Leave it empty to use the default system printer.
  • Set the WebSocket User to the Odoo user that will run the odoo-print-client agent. Print jobs are delivered through the bus subscription of this user.
  • Assign the printer as the default globally, per user, or per report following the standard base_report_to_printer workflow.
  • Install and run the odoo-print-client agent on the machine connected to the printer pip install odoo-print-client odoo-printer --url "https://odoo.example.com" --db "prod" --user "admin" --password "admin" See odoo-print-client on PyPI for full configuration options.

Once configured, printing works transparently. When a user prints a report that is set to Send to Printer and the assigned printer uses the WebSocket backend, the module will:

  • Render the report as PDF.
  • Encode the PDF content in Base64.
  • Send a print_job message through the bus to the printer's configured user with the following payload { "printer_name": "", "file_data": "" }

The recommended client-side agent is odoo-print-client, which connects as the configured user and forwards jobs to the local printer.

No verified information in OCA: Installation.

info

Data imported from GitHub: this sheet reflects the latest catalog review, not a live lookup. Always check the module documentation and staging before installing in production.