From df0c60ccc7cb86e00b7d4000de6aa59186968818 Mon Sep 17 00:00:00 2001 From: Joseph Caburnay Date: Fri, 31 Jan 2020 08:22:25 +0000 Subject: [PATCH] [FIX] point_of_sale: invoiced receipt screen not shown if offline The following steps will reproduce the issue: 1. Activate invoicing in the pos config 2. Start a new session 3. Switch browser to offline mode (or stop the odoo server) 4. Make an order 5. Invoice the order during payment 6. Validate 7. Error shows (which is okay) 8. The problem is that the receipt screen is not shown after validation. The intended behavior is that the receipt screen will show with an additional Print Invoice button above the receipt. The problem is caused by wrong signature of the thrown error when the _save_to_server is called. The signature understood by the error handlers is the one by `error` and not by `reason`. See _handleFailedPushForInvoice which is the main consumer of the error thrown by the _save_to_server call. closes odoo/odoo#44392 X-original-commit: 5d593eb31ce7d545a57cb93bc9834e4cebadea19 Signed-off-by: pimodoo --- addons/point_of_sale/static/src/js/models.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/point_of_sale/static/src/js/models.js b/addons/point_of_sale/static/src/js/models.js index f84b414d83a..5b16cf23dfb 100644 --- a/addons/point_of_sale/static/src/js/models.js +++ b/addons/point_of_sale/static/src/js/models.js @@ -1038,7 +1038,7 @@ exports.PosModel = Backbone.Model.extend({ } console.warn('Failed to send orders:', orders); self.gui.show_sync_error_popup(); - throw reason; + throw error; }); },