From 02d9b51e43904420afe31e1f65ea455e3ed2c8ea Mon Sep 17 00:00:00 2001 From: Joseph Caburnay Date: Tue, 25 May 2021 09:17:57 +0000 Subject: [FIX] point_of_sale: compare the quantity to number type When identifying whether to show the decrease quantity popup or not, the current quantity of the selected orderline is compared to the new input quantity. This fix properly compares the current quantity to the new input quantity in number format. --- .../static/src/js/Screens/ProductScreen/ProductScreen.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/addons/point_of_sale/static/src/js/Screens/ProductScreen/ProductScreen.js b/addons/point_of_sale/static/src/js/Screens/ProductScreen/ProductScreen.js index 509de03c8a6..97daa35801d 100644 --- a/addons/point_of_sale/static/src/js/Screens/ProductScreen/ProductScreen.js +++ b/addons/point_of_sale/static/src/js/Screens/ProductScreen/ProductScreen.js @@ -8,6 +8,7 @@ odoo.define('point_of_sale.ProductScreen', function(require) { const Registries = require('point_of_sale.Registries'); const { onChangeOrder, useBarcodeReader } = require('point_of_sale.custom_hooks'); const { useState } = owl.hooks; + const { parse } = require('web.field_utils'); class ProductScreen extends ControlButtonsMixin(PosComponent) { constructor() { @@ -170,11 +171,12 @@ odoo.define('point_of_sale.ProductScreen', function(require) { }); return; } + const parsedInput = parse.float(event.detail.buffer) || 0 if(lastId != selectedLine.cid) this._showDecreaseQuantityPopup(); - else if(currentQuantity < event.detail.buffer) + else if(currentQuantity < parsedInput) this._setValue(event.detail.buffer); - else if(event.detail.buffer < currentQuantity) + else if(parsedInput < currentQuantity) this._showDecreaseQuantityPopup(); } else { let { buffer } = event.detail; -- cgit v1.2.3