diff options
| -rw-r--r-- | addons/point_of_sale/static/src/js/Misc/AbstractReceiptScreen.js | 6 | ||||
| -rw-r--r-- | addons/pos_restaurant/static/src/js/Screens/TipScreen.js | 3 |
2 files changed, 2 insertions, 7 deletions
diff --git a/addons/point_of_sale/static/src/js/Misc/AbstractReceiptScreen.js b/addons/point_of_sale/static/src/js/Misc/AbstractReceiptScreen.js index 6abf4b2e93d..2ebdce20e3f 100644 --- a/addons/point_of_sale/static/src/js/Misc/AbstractReceiptScreen.js +++ b/addons/point_of_sale/static/src/js/Misc/AbstractReceiptScreen.js @@ -39,13 +39,9 @@ odoo.define('point_of_sale.AbstractReceiptScreen', function (require) { return await this._printWeb(); } } - /** - * https://stackoverflow.com/questions/21285902/printing-a-part-of-webpage-with-javascript - */ async _printWeb() { try { - const isPrinted = document.execCommand('print', false, null); - if (!isPrinted) window.print(); + window.print(); return true; } catch (err) { await this.showPopup('ErrorPopup', { diff --git a/addons/pos_restaurant/static/src/js/Screens/TipScreen.js b/addons/pos_restaurant/static/src/js/Screens/TipScreen.js index e80a157bb54..bb6e17a21bb 100644 --- a/addons/pos_restaurant/static/src/js/Screens/TipScreen.js +++ b/addons/pos_restaurant/static/src/js/Screens/TipScreen.js @@ -136,8 +136,7 @@ odoo.define('pos_restaurant.TipScreen', function (require) { async _printWeb(receipt) { try { $(this.el).find('.pos-receipt-container').html(receipt); - const isPrinted = document.execCommand('print', false, null); - if (!isPrinted) window.print(); + window.print(); } catch (err) { await this.showPopup('ErrorPopup', { title: this.env._t('Printing is not supported on some browsers'), |
