[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.

X-original-commit: 61bb684c4b610227a3a22e68512146dc2ee5974d
This commit is contained in:
Joseph Caburnay
2021-05-31 12:40:59 +00:00
parent 4ab47ee741
commit d64a58007d
@@ -9,6 +9,7 @@ odoo.define('point_of_sale.ProductScreen', function(require) {
const { onChangeOrder, useBarcodeReader } = require('point_of_sale.custom_hooks');
const { Gui } = require('point_of_sale.Gui');
const { useState } = owl.hooks;
const { parse } = require('web.field_utils');
class ProductScreen extends ControlButtonsMixin(PosComponent) {
constructor() {
@@ -168,11 +169,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;