-
Notifications
You must be signed in to change notification settings - Fork 24.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[FIX] sale_loyalty : Don't show discounts that are already claimed #173555
[FIX] sale_loyalty : Don't show discounts that are already claimed #173555
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
seems to make sense to me
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
cee21df
to
831926d
Compare
831926d
to
61b1edb
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hello @yoba-odoo
Thanks for your changes, could you also change the title of your commit message?
The comments left are only nitpicking comments, after that, this will be ready to merge ^^
Have a nice day,
Steps to reproduce: - Install eCommerce and Loyalty module - Create a Discount that is applied using code - Generate coupon codes - Modify the balance of the codes to be more than 1 - Go to website and create an order - Proceed to checkout and apply one of the codes Current behavior before PR: The reward will be shown as claimable even after we already applied its code. This will lead that the user can be able to claim it more than once in the same order. This is happening becuase when getting the claimable rewards we are fetching the rewards that already got applied. https://github.com/odoo/odoo/blob/16.0/addons/sale_loyalty/models/sale_order.py#L655 Desired behavior after PR is merged: We are excluding the already-applied discounts on the order to avoid using them more than once in the same order. opw-4018909
61b1edb
to
8046f9c
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Steps to reproduce: - Install eCommerce and Loyalty module - Create a Discount that is applied using code - Generate coupon codes - Modify the balance of the codes to be more than 1 - Go to website and create an order - Proceed to checkout and apply one of the codes Current behavior before PR: The reward will be shown as claimable even after we already applied its code. This will lead that the user can be able to claim it more than once in the same order. This is happening becuase when getting the claimable rewards we are fetching the rewards that already got applied. https://github.com/odoo/odoo/blob/16.0/addons/sale_loyalty/models/sale_order.py#L655 Desired behavior after PR is merged: We are excluding the already-applied discounts on the order to avoid using them more than once in the same order. opw-4018909 closes #173555 Signed-off-by: Morgane Demesmaeker <edm@odoo.com>
Hi @yoba-odoo ! This change you made causes all rewards of type "discount" to disappear when any other reward is applied on the SO, even if they haven't actually been applied yet. I will let you know when the Odoo ticket is created, but I wanted to ping you so that we can hopefully get a fix as soon as possible. Don't hesitate to contact me if you want some help. |
Hello @azl-odoo |
Steps to reproduce:
Current behavior before PR:
The reward will be shown as claimable even after we already applied its code. This will lead that the user can be able to claim it more than once in the same order. This is happening becuase when getting the claimable rewards we are fetching the rewards that already got applied. https://github.com/odoo/odoo/blob/16.0/addons/sale_loyalty/models/sale_order.py#L655
Desired behavior after PR is merged:
We are excluding the already-applied coupons on the order to avoid using them more than once in the same order.
opw-4018909