From 0fd502ed9fedc1e0ca359eec51fb25c6acb9b699 Mon Sep 17 00:00:00 2001 From: Wolfgang Taferner Date: Fri, 31 Mar 2017 10:12:42 +0200 Subject: [PATCH] [IMP] point_of_sale: allow to override auto printing As show is needed to call super it is impossible to override the function without running into the immediate print. It is possible though that you might need some delay that local CPU has rendered everything on the PoS Ticket before printing...based on this you are able to override the handle_auto_print and add a delay there. Closes #16174 --- addons/point_of_sale/static/src/js/screens.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/addons/point_of_sale/static/src/js/screens.js b/addons/point_of_sale/static/src/js/screens.js index 5b8933c4cc7..e515390152c 100644 --- a/addons/point_of_sale/static/src/js/screens.js +++ b/addons/point_of_sale/static/src/js/screens.js @@ -1404,7 +1404,9 @@ var ReceiptScreenWidget = ScreenWidget.extend({ this.render_change(); this.render_receipt(); - + this.handle_auto_print(); + }, + handle_auto_print: function() { if (this.should_auto_print()) { this.print(); if (this.should_close_immediately()){ @@ -1413,7 +1415,6 @@ var ReceiptScreenWidget = ScreenWidget.extend({ } else { this.lock_screen(false); } - }, should_auto_print: function() { return this.pos.config.iface_print_auto && !this.pos.get_order()._printed;