From 42413faf61579bd745e891ad82647c10fc59e1b4 Mon Sep 17 00:00:00 2001 From: mgh-odoo Date: Thu, 16 May 2019 04:53:26 +0000 Subject: [PATCH] [FIX] point_of_sale: discount applied twice * Setup an IoTBox connected to a receipt printer * In POS Config: - IoT Box: check "IoTBox", set the IP of the Box and check "Receipt Printer" - Pricing: Select "Tax-Included Price" * Start the POS, select any product * Click on "Disc" on the virutal keyboard on the bottom left of the POS * Enter the amount of the discount * Validatate payment (Click "Payment" > "Cash" > Enter Amount > "Validate") * A ticket should print on the receipt printer: - The price in the rigth column is correct Current behaviour: * In the left column, it shows : Product name, Base price, Discount: X%, 1 x Price --> This price is not correct, it shows the price with the discount applied twice. Expected behaviour: * Discount applied once everywhere on ticket. task-1978564 closes odoo/odoo#34278 Signed-off-by: Nicolas Martinelli (nim) --- addons/point_of_sale/static/src/js/models.js | 4 ++-- addons/point_of_sale/static/src/xml/pos.xml | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/addons/point_of_sale/static/src/js/models.js b/addons/point_of_sale/static/src/js/models.js index 054776e658c..714b3c475f7 100644 --- a/addons/point_of_sale/static/src/js/models.js +++ b/addons/point_of_sale/static/src/js/models.js @@ -1637,9 +1637,9 @@ exports.Orderline = Backbone.Model.extend({ }, get_display_price_one: function(){ var rounding = this.pos.currency.rounding; - var price_unit = this.get_unit_price() * (1.0 - (this.get_discount() / 100.0)); + var price_unit = this.get_unit_price(); if (this.pos.config.iface_tax_included !== 'total') { - return round_pr(price_unit, rounding); + return round_pr(price_unit * (1.0 - (this.get_discount() / 100.0)), rounding); } else { var product = this.get_product(); var taxes_ids = product.taxes_id; diff --git a/addons/point_of_sale/static/src/xml/pos.xml b/addons/point_of_sale/static/src/xml/pos.xml index 0ac71c21530..49079e59c69 100644 --- a/addons/point_of_sale/static/src/xml/pos.xml +++ b/addons/point_of_sale/static/src/xml/pos.xml @@ -791,8 +791,8 @@ + -