diff options
| author | mgh-odoo <mgh@odoo.com> | 2019-05-16 04:53:26 +0000 |
|---|---|---|
| committer | Gert Pellin <gpe@odoo.com> | 2019-06-20 11:23:39 +0000 |
| commit | 42413faf61579bd745e891ad82647c10fc59e1b4 (patch) | |
| tree | 9864d2a62bfc71ccd59f5dcffa1a50ee947a772c /addons | |
| parent | 1f62977d5dcfbd172459f13d8e43bbf43c7bcbda (diff) | |
[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) <nim@odoo.com>
Diffstat (limited to 'addons')
| -rw-r--r-- | addons/point_of_sale/static/src/js/models.js | 4 | ||||
| -rw-r--r-- | 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 @@ <left><t t-esc='line.product_name_wrapped[0]' /></left> <right><value t-att-value-decimals='pos.currency.decimals'><t t-esc='line.price_display' /></value></right> </line> + <t t-call="XmlReceiptWrappedProductNameLines"/> </t> - <t t-call="XmlReceiptWrappedProductNameLines"/> <t t-if='!simple'> <line><left><t t-esc='line.product_name_wrapped[0]' /></left></line> <t t-call="XmlReceiptWrappedProductNameLines"/> |
