[FIX] website_sale_loyalty: correct taxcloud taxes on 'shop/payment'

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) <sesn@odoo.com>
This commit is contained in:
sesn-odoo
2023-11-30 18:38:03 +00:00
parent 68611eef02
commit 9519eec339
@@ -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):