Hi,
In odoo 17 i have created a custom receipts i need to print that while clicking on a button, it is downloading but not printed on the printer that connected to my PC, how do i solve that, i need to the receipts into my local printer at the same time am clicking on the button, how do i do that in Odoo 17?
setup() { super.setup(...arguments); this.printer = useService("printer");},
try { await this.printer.print(PaymentReceipt,
{ data: receiptData, });} catch (error) { console.error("❌ Printing failed:", error);}
Hello,
The reason it is downloading instead of printing is that the printHtml method (and the underlying print service) defaults to a browser download if it cannot find a hardware-linked destination.
So check the printer connected with system and verify that it support without IOT box.
Let me know if you need any help regarding this
Thanks
I want to print this in using the USB printer, so how do i change the code? Currently this.printer.print is for network printers
By default, if Odoo doesn't detect an IoT Box or a configured network printer, the browser falls back to downloading the PDF. So try to update code with window.print(). (temporary based)
If still not worked let me know
info@codespheretech.in
Thanks
How do i code this instead of printer.print, which method i use, and also how do i disable the print popup option, i need to direct print from the kiosk of pos.