From 23b3852dd0bfd469247eadd8abe7ed32a36be0a2 Mon Sep 17 00:00:00 2001 From: rhe-odoo Date: Tue, 7 Jun 2022 09:10:23 +0000 Subject: [PATCH] [FIX] point_of_sale: null value set quantity Before this fix, when clicking on the delete button from the product screen, when the decrease quantity popup was supposed to be shown, there was a null value issue and thus a traceback. With this fix, we force the value to be 0 instead of null. closes odoo/odoo#92854 Signed-off-by: Masereel Pierre --- addons/l10n_fr_pos_cert/static/src/css/pos.css | 2 +- addons/point_of_sale/static/src/js/models.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/addons/l10n_fr_pos_cert/static/src/css/pos.css b/addons/l10n_fr_pos_cert/static/src/css/pos.css index 57dca4137df..1fae724ac47 100644 --- a/addons/l10n_fr_pos_cert/static/src/css/pos.css +++ b/addons/l10n_fr_pos_cert/static/src/css/pos.css @@ -1,3 +1,3 @@ .oldPrice { font-weight: bold; -} \ No newline at end of file +} diff --git a/addons/point_of_sale/static/src/js/models.js b/addons/point_of_sale/static/src/js/models.js index de9daf2e001..14abf961475 100644 --- a/addons/point_of_sale/static/src/js/models.js +++ b/addons/point_of_sale/static/src/js/models.js @@ -1309,7 +1309,7 @@ class Orderline extends PosModel { this.order.remove_orderline(this); return true; }else{ - var quant = typeof(quantity) === 'number' ? quantity : (field_utils.parse.float('' + quantity) || 0); + var quant = typeof(quantity) === 'number' ? quantity : (field_utils.parse.float('' + (quantity ? quantity : 0 ))); if (this.refunded_orderline_id in this.pos.toRefundLines) { const toRefundDetail = this.pos.toRefundLines[this.refunded_orderline_id]; const maxQtyToRefund = toRefundDetail.orderline.qty - toRefundDetail.orderline.refundedQty