[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) <wbr@odoo.com>
This commit is contained in:
roen-odoo
2022-08-10 20:28:52 +02:00
parent c6524ee9d6
commit ebfe87c61f
@@ -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):