diff options
| author | Joseph Caburnay <jcb@odoo.com> | 2021-05-25 09:17:57 +0000 |
|---|---|---|
| committer | Joseph Caburnay <jcb@odoo.com> | 2021-05-25 09:44:54 +0000 |
| commit | 02d9b51e43904420afe31e1f65ea455e3ed2c8ea (patch) | |
| tree | 6f2a73e0f251e0112c8bce02a0c1e7a6e7e0560a /addons | |
| parent | a37935b466e3d74e08d5ea41047185144e8e5b6f (diff) | |
[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.
Diffstat (limited to 'addons')
| -rw-r--r-- | addons/point_of_sale/static/src/js/Screens/ProductScreen/ProductScreen.js | 6 |
1 files 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; |
