From c9a58904c55953752be22e5a9343a2f2b4903a28 Mon Sep 17 00:00:00 2001 From: roen-odoo Date: Thu, 12 May 2022 11:58:30 +0000 Subject: [PATCH] [FIX] pos_sale: correct value in untaxed_amount of sale report Current behavior: When selling a product that have a taxe set in a PoS, the sale report was not correct. The collumn untaxed amount to invoice would contains the amount to invoice that includes the taxes wich is not correct. Steps to reproduce: - Install sales & pos - Set the Acoustic bloc screen tax to 15% - Open a pos session and Sell an acoustic bloc screen - Validate the payment and close the session - Open the sales app - Sell an acoustic bloc screen to any customer - Deliver it (update it's quantity if necessary) - Sales > Reporting > Sales - Switch to the pivot view - On the "measures" button, check "Untaxed Amount Invoiced" and "Untaxed Amount To Invoice" - Show the entries by Order# - "Untaxed amount to invoice" should be the same as "untaxed total" opw-2681477 closes odoo/odoo#92217 X-original-commit: 8c20fb4e126822d81fa7e1de6912d5c75a881b7b Signed-off-by: Trinh Jacky (trj) Signed-off-by: Engels Robin (roen) --- addons/pos_sale/report/sale_report.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/addons/pos_sale/report/sale_report.py b/addons/pos_sale/report/sale_report.py index 31ea63057fc..6a8116d1430 100644 --- a/addons/pos_sale/report/sale_report.py +++ b/addons/pos_sale/report/sale_report.py @@ -40,11 +40,11 @@ class SaleReport(models.Model): * MIN({self._case_value_or_one('pos.currency_rate')}) * {self._case_value_or_one('currency_table.rate')} AS price_subtotal, - (CASE WHEN pos.state != 'invoiced' THEN SUM(l.price_subtotal_incl) ELSE 0 END) + (CASE WHEN pos.state != 'invoiced' THEN SUM(l.price_subtotal) ELSE 0 END) * MIN({self._case_value_or_one('pos.currency_rate')}) * {self._case_value_or_one('currency_table.rate')} AS amount_to_invoice, - (CASE WHEN pos.state = 'invoiced' THEN SUM(l.price_subtotal_incl) ELSE 0 END) + (CASE WHEN pos.state = 'invoiced' THEN SUM(l.price_subtotal) ELSE 0 END) * MIN({self._case_value_or_one('pos.currency_rate')}) * {self._case_value_or_one('currency_table.rate')} AS amount_invoiced,