From 9519eec339df41984721e8a0f0093893c88c32bd Mon Sep 17 00:00:00 2001 From: sesn-odoo Date: Mon, 20 Nov 2023 11:22:51 +0100 Subject: [PATCH] [FIX] website_sale_loyalty: correct taxcloud taxes on 'shop/payment' MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Summary ------- Taxcloud taxes are always 0 on payment page. Steps to reproduce ------------------ * install `website_sale_loyalty` and `website_sale_account_taxcloud` * configure taxcloud * enable 'Detect Automatically' on the 'Automatic Tax Mapping (TaxCloud)' fiscal position * go to ecommerce, and add a product to cart * go to cart * proceed to checkout You should see that the taxes are still 0 on the payment page Cause ----- The issue comes from the `shop_payment()` override in `website_sale_loyalty`. The taxcloud taxes are computed with `res = super(WebsiteSale, self).shop_payment(**post)`, but they are immediately cleared with `order._update_programs_and_rewards()` opw-3539027 closes odoo/odoo#144250 X-original-commit: 051470a16f3a76689eaeb6db57ac3d98a60c1f4d Signed-off-by: Séna Serge Nshimiyimana (sesn) --- addons/website_sale_loyalty/controllers/main.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/addons/website_sale_loyalty/controllers/main.py b/addons/website_sale_loyalty/controllers/main.py index a507e8deb38..514adc86fce 100644 --- a/addons/website_sale_loyalty/controllers/main.py +++ b/addons/website_sale_loyalty/controllers/main.py @@ -33,11 +33,10 @@ class WebsiteSale(main.WebsiteSale): @http.route() def shop_payment(self, **post): order = request.website.sale_get_order() - res = super(WebsiteSale, self).shop_payment(**post) if order: order._update_programs_and_rewards() order._auto_apply_rewards() - return res + return super(WebsiteSale, self).shop_payment(**post) @http.route() def cart(self, **post):