diff --git a/addons/point_of_sale/static/src/js/Screens/PaymentScreen/PaymentScreen.js b/addons/point_of_sale/static/src/js/Screens/PaymentScreen/PaymentScreen.js index 553309cdf1d..867a5d4241a 100644 --- a/addons/point_of_sale/static/src/js/Screens/PaymentScreen/PaymentScreen.js +++ b/addons/point_of_sale/static/src/js/Screens/PaymentScreen/PaymentScreen.js @@ -31,6 +31,7 @@ odoo.define('point_of_sale.PaymentScreen', function (require) { onChangeOrder(this._onPrevOrder, this._onNewOrder); useErrorHandlers(); this.payment_interface = null; + this.error = false; this.payment_methods_from_config = this.env.pos.payment_methods.filter(method => this.env.pos.config.payment_method_ids.includes(method.id)); } get currentOrder() { @@ -226,7 +227,7 @@ odoo.define('point_of_sale.PaymentScreen', function (require) { } } get nextScreen() { - return 'ReceiptScreen'; + return !this.error? 'ReceiptScreen' : 'ProductScreen'; } async _isOrderValid(isForceValidate) { if (this.currentOrder.get_orderlines().length === 0) { diff --git a/addons/point_of_sale/static/src/js/custom_hooks.js b/addons/point_of_sale/static/src/js/custom_hooks.js index bedad8fbbad..c1e87b24ecb 100644 --- a/addons/point_of_sale/static/src/js/custom_hooks.js +++ b/addons/point_of_sale/static/src/js/custom_hooks.js @@ -38,6 +38,14 @@ odoo.define('point_of_sale.custom_hooks', function (require) { error.data.debug || this.env._t('The server encountered an error while receiving your order.'), }); + } else if (error.code === 700) { + // Fiscal module errors + await this.showPopup('ErrorPopup', { + title: this.env._t('Fiscal data module error'), + body: + error.data.error.status || + this.env._t('The fiscal data module encountered an error while receiving your order.'), + }); } else { // ??? await this.showPopup('ErrorPopup', {