From c836967a719b07938b2c9c0fcdba95b863424d7c Mon Sep 17 00:00:00 2001 From: Joseph Caburnay Date: Wed, 24 Aug 2022 11:50:29 +0000 Subject: [PATCH] [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 --- addons/point_of_sale/static/src/js/printers.js | 1 + 1 file changed, 1 insertion(+) diff --git a/addons/point_of_sale/static/src/js/printers.js b/addons/point_of_sale/static/src/js/printers.js index 4eb6ea64303..f15d8281439 100644 --- a/addons/point_of_sale/static/src/js/printers.js +++ b/addons/point_of_sale/static/src/js/printers.js @@ -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);