Skip to content
Snippets Groups Projects
Commit b3322ecc authored by Thomas Lefebvre (thle)'s avatar Thomas Lefebvre (thle)
Browse files

[FIX] sale_loyalty: correct display coupon points


Steps to reproduce:
- install website_sale and website_sale_loyalty;
- activate Payment Providers Demo and Wire Transfer;
- put them in 'test mode';
- go to ecommerce;
- add a gift card;
- process the checkout.

Issue:
Depending on the configuration of the payment acquirer used,
sometimes the amount displayed is doubled
(in the display of the gift card amount
after the payment process in brackets).

- Demo in test mode: amount will be doubled
- Wire Transfer in test mode: amount will not be doubled

Remark:
The amounts are correct in the backend.

Cause:
Sometimes the `action_confirm` function is used and sometimes it is not.
When you enter it, the points of the coupon are already set.
Therefore, we add the amount again in the `_get_real_points_for_coupon`.

Solution:
Display the information of the gift card only
when the sale order is validated.
Therefore, there is no need to bypass (with `post_confirm`)
to add the points that will be valid when the sale order is confirmed.
Because with the display correction, we won't see the points.

opw-3166164

closes odoo/odoo#113246

Signed-off-by: default avatarLefebvre Thomas (thle) <thle@odoo.com>
parent bb0fe713
No related branches found
No related tags found
No related merge requests found
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment