From addda62d548a04a08ac37e17e1afe5412c87f368 Mon Sep 17 00:00:00 2001 From: Andro Gvivradze Date: Thu, 20 Jan 2022 10:27:36 +0000 Subject: [PATCH] [FIX] point_sale: Width of reciept is calculated for smaller devices When user tries to print a receipt from a small device, sometimes receipt is cropped on the right side. This happens because unlike height, receipt width is not calculated, instead it is equal to the width of the receipt div. The width of the receipt is equal to the outer width of the receipt instead of div and the receipts are not cropped anymore. OPW-2721030 closes odoo/odoo#83142 X-original-commit: c327670e9830506f29c9778bd428ee65964ec622 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 ae10695cbca..dd962daae59 100644 --- a/addons/point_of_sale/static/src/js/printers.js +++ b/addons/point_of_sale/static/src/js/printers.js @@ -99,6 +99,7 @@ var PrinterMixin = { html2canvas(self.receipt[0], { onparsed: function(queue) { queue.stack.ctx.height = Math.ceil(self.receipt.outerHeight() + self.receipt.offset().top); + queue.stack.ctx.width = Math.ceil(self.receipt.outerWidth() + self.receipt.offset().left); }, onrendered: function (canvas) { $('.pos-receipt-print').empty();