From eafbae34ab5506a97fb07498df0643d55964f290 Mon Sep 17 00:00:00 2001 From: Goffin Simon Date: Wed, 23 Jun 2021 09:38:59 +0000 Subject: [PATCH] [FIX] point_of_sale: Scanning Barcode EAN-13 with price MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Steps to reproduce the bug: - Let's consider a product P with sale price = 0€ - P is available in the POS - Set a barcode to P, 2312345000002 (meaning price = 0€ with check digit = 2) - Open a session in the POS and scan 2312345003003 (meaning price = 3€ with check digit = 3) Bug: A line was added with P but its price was 0€ instead of 3€ PS: Function _getAddProductOptions always sets price_extra to 0€ opw:2566502 closes odoo/odoo#73245 X-original-commit: ee567231a16b12031c234400a6a37bb5b7898cec Signed-off-by: Simon Goffin (sig) Signed-off-by: pimodoo --- addons/point_of_sale/static/src/js/models.js | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/addons/point_of_sale/static/src/js/models.js b/addons/point_of_sale/static/src/js/models.js index 3ddf7223de7..43968c916fa 100644 --- a/addons/point_of_sale/static/src/js/models.js +++ b/addons/point_of_sale/static/src/js/models.js @@ -2999,17 +2999,17 @@ exports.Order = Backbone.Model.extend({ orderline.set_quantity(options.quantity); } - if(options.price !== undefined){ - orderline.set_unit_price(options.price); - this.fix_tax_included_price(orderline); - } - if (options.price_extra !== undefined){ orderline.price_extra = options.price_extra; orderline.set_unit_price(orderline.product.get_price(this.pricelist, orderline.get_quantity(), options.price_extra)); this.fix_tax_included_price(orderline); } + if(options.price !== undefined){ + orderline.set_unit_price(options.price); + this.fix_tax_included_price(orderline); + } + if(options.lst_price !== undefined){ orderline.set_lst_price(options.lst_price); }