[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 <pim@odoo.com>
This commit is contained in:
rhe-odoo
2022-06-16 16:03:29 +02:00
parent eec29ec1ea
commit 23b3852dd0
2 changed files with 2 additions and 2 deletions
@@ -1,3 +1,3 @@
.oldPrice {
font-weight: bold;
}
}
+1 -1
View File
@@ -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