From e0c9b9c2cd4f0a2d965d27b4f241d941e5bcd8a7 Mon Sep 17 00:00:00 2001 From: Martin Trigaux Date: Thu, 15 Dec 2016 14:41:37 +0100 Subject: [PATCH] [IMP] point_of_sale: more informative error The pos loading crashes in the following scenario. 1. start selling a product (order line the localstorage) 2. archive or delete the product in backend 3. reload the pos session The POS is interrupted with not much information. Give an error a bit more meaningful. --- addons/point_of_sale/static/src/js/models.js | 3 ++- 1 file changed, 2 insertions(+), 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 219f6c75cfa..3880049e6d3 100644 --- a/addons/point_of_sale/static/src/js/models.js +++ b/addons/point_of_sale/static/src/js/models.js @@ -1081,7 +1081,8 @@ exports.Orderline = Backbone.Model.extend({ init_from_JSON: function(json) { this.product = this.pos.db.get_product_by_id(json.product_id); if (!this.product) { - console.error('ERROR: attempting to recover product not available in the point of sale'); + console.error('ERROR: attempting to recover product ID', json.product_id, + 'not available in the point of sale. Correct the product or clean the browser cache.'); } this.price = json.price_unit; this.set_discount(json.discount);