[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 <pimodoo@users.noreply.github.com>
This commit is contained in:
Joseph Caburnay
2020-02-03 12:15:32 +00:00
parent 3fd7b2009e
commit df0c60ccc7
+1 -1
View File
@@ -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;
});
},