[FIX] point_of_sale: group products with pricelist
Before this fix products in a pricelist would not be grouped when there is a decimal value in the price. This problem was caused by a trailing rounding error, for instance a price of 29.90 could give a pricelist price of 29.900000000002. To solve this we check if Math.round((price - pricelist-price)/currency-rounding) gives 0 as a result, if so, the price is equal to the pricelist price and the product can be grouped. solves: https://github.com/odoo/odoo/issues/28521#issuecomment-443148920 closes odoo/odoo#29185
This commit is contained in:
@@ -1525,7 +1525,8 @@ exports.Orderline = Backbone.Model.extend({
|
||||
return false;
|
||||
}else if(this.get_discount() > 0){ // we don't merge discounted orderlines
|
||||
return false;
|
||||
}else if(price !== orderline.get_product().get_price(orderline.order.pricelist, this.get_quantity())){
|
||||
}else if(!utils.float_is_zero(price - orderline.get_product().get_price(orderline.order.pricelist, this.get_quantity()),
|
||||
this.pos.currency.decimals)){
|
||||
return false;
|
||||
}else if(this.product.tracking == 'lot') {
|
||||
return false;
|
||||
|
||||
Reference in New Issue
Block a user