From bc913d9d2b0801ded7ae559238c2128270ca2361 Mon Sep 17 00:00:00 2001 From: Goffin Simon Date: Thu, 30 Aug 2018 16:46:08 +0200 Subject: [PATCH] [FIX] point_of_sale: Print receipt on Safari As explained on stackoverflow with https://stackoverflow.com/questions/23626998/safari-print-issue-with-javascript-window-print There is an issue with javascript window.print() on Safari Steps to reproduce the bug: When clicking on button "Print receipt" in the point of sale, nothing happened. opw:1858205 --- addons/point_of_sale/static/src/js/screens.js | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/addons/point_of_sale/static/src/js/screens.js b/addons/point_of_sale/static/src/js/screens.js index 95a7555e5d2..bb6e5a1f1cf 100644 --- a/addons/point_of_sale/static/src/js/screens.js +++ b/addons/point_of_sale/static/src/js/screens.js @@ -1547,7 +1547,12 @@ var ReceiptScreenWidget = ScreenWidget.extend({ }; }, print_web: function() { - window.print(); + if($.browser.safari){ + document.execCommand('print', false, null); + } + else{ + window.print(); + } this.pos.get_order()._printed = true; }, print_xml: function() {