From 8554e6f88cdb6640f8fa25dcf18e36e5a1f6126b Mon Sep 17 00:00:00 2001 From: roen-odoo Date: Tue, 3 Oct 2023 09:52:38 +0000 Subject: [PATCH] [FIX] pos_restaurant: fix blank receipt print Current behavior: When trying to print the bill in PoS restaurant from a mobile device, the bill appears completely blank. Steps to reproduce: - Open Odoo on mobile device - Go to PoS restaurant - Create an order - Click on the "Bill" button - Click on the "Print" button - The bill is completely blank This is happening because on mobile after clicking on the "Print" button the pos directly return to the order screen. What happens when you do `window.print()` is you basically do a screenshot of the screen with some specific CSS rules. But on mobile, we go back too fast on the order screen and the screenshot is empty. opw-3507918 closes odoo/odoo#138282 X-original-commit: ebf214944097b9731a2a5dcf53d367715ceb8a35 Signed-off-by: Vlad Stroia (vlst) Signed-off-by: Robin Engels (roen) --- .../static/src/app/bill_screen/bill_screen.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/addons/pos_restaurant/static/src/app/bill_screen/bill_screen.js b/addons/pos_restaurant/static/src/app/bill_screen/bill_screen.js index d6b1eea8c84..a75e9db2544 100644 --- a/addons/pos_restaurant/static/src/app/bill_screen/bill_screen.js +++ b/addons/pos_restaurant/static/src/app/bill_screen/bill_screen.js @@ -6,8 +6,10 @@ import { registry } from "@web/core/registry"; export class BillScreen extends ReceiptScreen { static template = "pos_restaurant.BillScreen"; confirm() { - this.props.resolve({ confirmed: true, payload: null }); - this.pos.closeTempScreen(); + if (!this.env.isMobile) { + this.props.resolve({ confirmed: true, payload: null }); + this.pos.closeTempScreen(); + } } /** * @override