[FIX] point_of_sale: large canvas is sent to the printer

In screen with high dpi, scale of the canvas generated by html2canvas
is larger than normal (defaulting to scale 2). Apparently, receipt
printers don't recognize this so in this fix, we force the scale
to 1.

closes odoo/odoo#98796

Signed-off-by: Masereel Pierre <pim@odoo.com>
This commit is contained in:
Joseph Caburnay
2022-08-25 10:32:01 +02:00
parent 4ac4096e8f
commit c836967a71
@@ -105,6 +105,7 @@ var PrinterMixin = {
return html2canvas(this.receipt[0], {
height: Math.ceil(this.receipt.outerHeight() + this.receipt.offset().top),
width: Math.ceil(this.receipt.outerWidth() + 2 * this.receipt.offset().left),
scale: 1,
}).then(canvas => {
$('.pos-receipt-print').empty();
return this.process_canvas(canvas);