diff --git a/addons/point_of_sale/static/src/app/store/models.js b/addons/point_of_sale/static/src/app/store/models.js index 3ec381655f6..8a7ee890191 100644 --- a/addons/point_of_sale/static/src/app/store/models.js +++ b/addons/point_of_sale/static/src/app/store/models.js @@ -506,7 +506,7 @@ export class Orderline extends PosModel { * @param {Object} modifiedPackLotLines key-value pair of String (the cid) & String (the new lot_name) * @param {Array} newPackLotLines array of { lot_name: String } */ - setPackLotLines({ modifiedPackLotLines, newPackLotLines }) { + setPackLotLines({ modifiedPackLotLines, newPackLotLines , setQuantity = true }) { // Set the new values for modified lot lines. const lotLinesToRemove = []; for (const lotLine of this.pack_lot_lines) { @@ -534,7 +534,7 @@ export class Orderline extends PosModel { } // Set the quantity of the line based on number of pack lots. - if (!this.product.to_weight) { + if (!this.product.to_weight && setQuantity) { this.set_quantity_by_lot(); } } @@ -2063,7 +2063,7 @@ export class Order extends PosModel { } if (options.draftPackLotLines) { - this.selected_orderline.setPackLotLines(options.draftPackLotLines); + this.selected_orderline.setPackLotLines({ ...options.draftPackLotLines, setQuantity: options.quantity === undefined }); } if (options.comboLines?.length) {