Report to printer via WebSocket
Project description
Report to printer via WebSocket
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 <https://pypi.org/project/odoo-print-client/>_ as the client-side agent to receive and print jobs.
Table of contents
Configuration
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 <https://pypi.org/project/odoo-print-client/>_ for full configuration options.
Usage
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": "<system_name of the printer>", "file_data": "<base64-encoded PDF>" }
The recommended client-side agent is odoo-print-client <https://pypi.org/project/odoo-print-client/>_, which connects as the configured user and forwards jobs to the local printer.
Bug Tracker
Bugs are tracked on GitHub Issues. In case of trouble, please check there if your issue has already been reported. If you spotted it first, help us to smash it by providing a detailed and welcomed feedback.
Do not contact contributors directly about support or help with technical issues.
Credits
Contributors
-
David Jiménez david.jimenez@forgeflow.com
-
Enric Tobella
Maintainers
This module is maintained by the OCA.
OCA, or the Odoo Community Association, is a nonprofit organization whose mission is to support the collaborative development of Odoo features and promote its widespread use.
This module is part of the OCA/report-print-send project on GitHub.
You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distributions
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file odoo_addon_base_report_to_printer_websocket-19.0.1.0.0.4-py3-none-any.whl.
File metadata
- Download URL: odoo_addon_base_report_to_printer_websocket-19.0.1.0.0.4-py3-none-any.whl
- Upload date:
- Size: 33.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
7b57d0d4763069b2eb907df4633e4d3e9e1f20ca8b3f7c5e08502e6739960bd9
|
|
| MD5 |
9d25d7af5350e80df8d5a40aefac1cef
|
|
| BLAKE2b-256 |
010efcc8c0b3a18bbaa0802c12f1e96a406e5c29b1d9d22ce9565f27a8fb9e63
|