[FIX] point_of_sale: prevent crash with float quantity when edit lot
Current behavior: In the PoS if you add a tracked product that uses "kg" as uom and change the quantity to any float value. After that if you try to modify the lot number you get an error. Steps to reproduce: - Have PoS installed - Create a tracked product that use kg as uom - Open PoS session - Add the product to the order and modify the quantity to any float value - Click on the green lines to edit the lot number - You get an error opw-2861426 [FIX] point_of_sale: float_serial Current behavior: Steps to reproduce: opw-2861426 closes odoo/odoo#92722 X-original-commit: 0aff8bb9484a23c0d875d3b12259dd4e0d51e716 Signed-off-by: Nicolas Lempereur (nle) <nle@odoo.com> Signed-off-by: Engels Robin (roen) <roen@odoo.com>
This commit is contained in:
@@ -1217,6 +1217,7 @@ class Orderline extends PosModel {
|
||||
getPackLotLinesToEdit(isAllowOnlyOneLot) {
|
||||
const currentPackLotLines = this.pack_lot_lines;
|
||||
let nExtraLines = Math.abs(this.quantity) - currentPackLotLines.length;
|
||||
nExtraLines = Math.ceil(nExtraLines);
|
||||
nExtraLines = nExtraLines > 0 ? nExtraLines : 1;
|
||||
const tempLines = currentPackLotLines
|
||||
.map(lotLine => ({
|
||||
|
||||
Reference in New Issue
Block a user