[FIX] point_of_sale: Scanning Barcode EAN-13 with price

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) <sig@openerp.com>
Signed-off-by: pimodoo <pimodoo@users.noreply.github.com>
This commit is contained in:
Goffin Simon
2021-07-05 15:01:40 +00:00
committed by Pierre Masereel
parent dddb10df25
commit eafbae34ab
+5 -5
View File
@@ -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);
}