diff --git a/addons/point_of_sale/static/src/js/screens.js b/addons/point_of_sale/static/src/js/screens.js index 8b1b001c340..7c1cb9559a6 100644 --- a/addons/point_of_sale/static/src/js/screens.js +++ b/addons/point_of_sale/static/src/js/screens.js @@ -1487,7 +1487,22 @@ var ReceiptScreenWidget = ScreenWidget.extend({ } }, print_web: function() { - window.print(); + if ($.browser.safari) { + document.execCommand('print', false, null); + } else { + try { + window.print(); + } catch(err) { + if (navigator.userAgent.toLowerCase().indexOf("android") > -1) { + this.gui.show_popup('error',{ + 'title':_t('Printing is not supported on some android browsers'), + 'body': _t('Printing is not supported on some android browsers due to no default printing protocol is available. It is possible to print your tickets by making use of an IoT Box.'), + }); + } else { + throw err; + } + } + } this.pos.get_order()._printed = true; }, print_xml: function() {