From 8d770ebd9bcf65ff8378635211b63b1fc1325e6b Mon Sep 17 00:00:00 2001 From: Maxime Vanderhaeghe Date: Thu, 13 Aug 2015 15:16:03 +0200 Subject: [PATCH] [FIX] : Allow possibility to give 100% discount. --- pos_pricelist/static/src/js/models.js | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/pos_pricelist/static/src/js/models.js b/pos_pricelist/static/src/js/models.js index c61fe32e..4aa54d71 100644 --- a/pos_pricelist/static/src/js/models.js +++ b/pos_pricelist/static/src/js/models.js @@ -147,7 +147,7 @@ function pos_pricelist_models(instance, module) { var price = this.pos.pricelist_engine.compute_price_all( db, product, partner, qty ); - if (price !== false && price !== 0.0) { + if (price !== false) { this.price = price; } } @@ -169,7 +169,7 @@ function pos_pricelist_models(instance, module) { var price = this.pos.pricelist_engine.compute_price_all( db, product, partner, quantity ); - if (price !== false && price !== 0.0) { + if (price !== false) { this.price = price; } this.trigger('change', this); @@ -533,7 +533,9 @@ function pos_pricelist_models(instance, module) { var quantities = []; quantities.push(1); for (var j = 0; j < rules.length; j++) { - quantities.push(rules[j].min_quantity); + if ($.inArray(rules[j].min_quantity, quantities) === -1) { + quantities.push(rules[j].min_quantity); + } } quantities = quantities.sort(); var prices_displayed = ''; @@ -542,7 +544,7 @@ function pos_pricelist_models(instance, module) { var price = this.compute_price_all( db, product, partner, qty ); - if (price !== false && price !== 0.0) { + if (price !== false) { if (this.pos.config.display_price_with_taxes) { var prices = this.simulate_price( product, partner, price, qty @@ -602,7 +604,7 @@ function pos_pricelist_models(instance, module) { var price = this.compute_price_all( db, product, partner, quantity ); - if (price !== false && price !== 0.0) { + if (price !== false) { line.price = price; } line.trigger('change', line);