[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 <pim@odoo.com>
This commit is contained in:
@@ -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();
|
||||
|
||||
Reference in New Issue
Block a user