From ec8106da5cbb0f2a491e97762518312689b0a949 Mon Sep 17 00:00:00 2001 From: "Adrien Guilliams (adgu)" Date: Tue, 8 Aug 2023 14:27:12 +0000 Subject: [PATCH] [FIX] point_of_sale: correct taxDetails where used improperly The tax details was recently changed and two places were it was used were forgotten during the changes. This led to bugs in the discount button with taxes that have the options "tax included in price" and to company using round globally as rounding method. Steps to reproduce the first bug: - Set at least one tax with the attribute "tax included in price" to true - Associate this tax to the config used - Activate the global discount setting - Open PoS and click on some products with the tax newly created - Click the discount button in the Action pad widget Steps to reproduct the second bug: - Set the setting Rounding method of your company to "Round globally" - Open PoS and click on products - The total shown is 0 closes odoo/odoo#132484 Signed-off-by: David Monnom (moda) --- addons/point_of_sale/static/src/app/store/models.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/addons/point_of_sale/static/src/app/store/models.js b/addons/point_of_sale/static/src/app/store/models.js index d4dbf2fa1e8..a42442723ad 100644 --- a/addons/point_of_sale/static/src/app/store/models.js +++ b/addons/point_of_sale/static/src/app/store/models.js @@ -934,7 +934,7 @@ export class Orderline extends PosModel { const taxDetails = this.get_tax_details(); return productTaxes .filter((tax) => tax.price_include) - .reduce((sum, tax) => sum + taxDetails[tax.id], 0); + .reduce((sum, tax) => sum + taxDetails[tax.id].amount, 0); } _map_tax_fiscal_position(tax, order = false) { return this.pos._map_tax_fiscal_position(tax, order); @@ -2233,7 +2233,7 @@ export class Order extends PosModel { if (!(taxId in groupTaxes)) { groupTaxes[taxId] = 0; } - groupTaxes[taxId] += taxDetails[taxId]; + groupTaxes[taxId] += taxDetails[taxId].amount; } });