From ebfe87c61ffab1db89b80437e0f03182f65b4cb1 Mon Sep 17 00:00:00 2001 From: roen-odoo Date: Tue, 26 Jul 2022 14:27:29 +0000 Subject: [PATCH] [FIX] website_sale_gift_card: correctly compute gift card with taxcloud Current behavior: When using taxcloud for tax computation and using a giftcard on the website shop, the giftcard amount is incorrect. Steps to reproduce: - Setup taxcloud for user A - Setup EasyPost or any other not free shipping methods - Activate giftcards for website - Login as user A in the website shop - Add an article to the cart - Process to checkout and pay with giftcard - The amount due is incorrect (negative value) See this video for full explanation on how to setup taxcloud and EasyPost : https://drive.google.com/file/d/1E5ADDDwr_UbjYq-0t4whllFaQlkRBUCD/view opw-2883592 closes odoo/odoo#97915 X-original-commit: 703b2d0f5ef520202361fd275b82b8dd12074f15 Related: odoo/enterprise#30300 Signed-off-by: William Braeckman (wbr) --- addons/website_sale_loyalty/controllers/main.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/addons/website_sale_loyalty/controllers/main.py b/addons/website_sale_loyalty/controllers/main.py index 5129298de41..1c798bf50ca 100644 --- a/addons/website_sale_loyalty/controllers/main.py +++ b/addons/website_sale_loyalty/controllers/main.py @@ -29,9 +29,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) order._update_programs_and_rewards() order._auto_apply_rewards() - return super(WebsiteSale, self).shop_payment(**post) + return res @http.route(['/shop/cart'], type='http', auth="public", website=True) def cart(self, **post):