-
Notifications
You must be signed in to change notification settings - Fork 23.2k
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
[FW][FIX] pos_restaurant: Grant loyalty points for products only #166099
Open
fw-bot
wants to merge
1
commit into
odoo:saas-17.1
Choose a base branch
from
odoo-dev:saas-17.1-16.0-opw-3855323-grant_loyalty_points_for_products_only-alhy-lmMB-fw
base: saas-17.1
Could not load branches
Branch not found: {{ refName }}
Could not load tags
Nothing to show
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
[FW][FIX] pos_restaurant: Grant loyalty points for products only #166099
fw-bot
wants to merge
1
commit into
odoo:saas-17.1
from
odoo-dev:saas-17.1-16.0-opw-3855323-grant_loyalty_points_for_products_only-alhy-lmMB-fw
+68
−1
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This PR targets saas-17.1 and is part of the forward-port chain. Further PRs will be created up to master. More info at https://github.com/odoo/odoo/wiki/Mergebot#forward-port |
@AH-Yussef @caburj ci/runbot failed on this forward-port PR |
AH-Yussef
force-pushed
the
saas-17.1-16.0-opw-3855323-grant_loyalty_points_for_products_only-alhy-lmMB-fw
branch
from
June 8, 2024 17:46
cc49366
to
9259490
Compare
@AH-Yussef @caburj this PR was modified / updated and has become a normal PR. It must be merged directly. |
C3POdoo
requested review from
a team and
davidmonnom
and removed request for
a team
June 8, 2024 17:48
Steps to reproduce: - Install POS app. - Go to POS > Products > Discount & Loyalty - Create a New program with: - Program Type: Loyalty Cards - Conditional rules: - Minimum Quantity: 2 - Grant: 1 Loyalty Points per unit paid - Rewards: - Reward Type: Discount - Discount: 100 % one Cheapest Product - In exchange of 2 Loyalty Points - Start a new POS session - Select a Customer - Add two different products. - Notice the Loyalty Points of +2 shown. This is Correct - Click on the Reward button - Notice how the Loyalty Points are now +3 which is obviously wrong given we only have two products. Basically it's as if the reward line (100% discount) is taken into consideration as the cheapest product. Investigation: - Inside `_updatePrograms`, `pointsForPrograms()` are calculated. - we sum the lines quantities regardless of whether it's a reward line or not https://github.com/odoo/odoo/blob/e5c3ba58964f47cfd41d337e39e1bf25eaa25379/addons/pos_loyalty/static/src/js/Loyalty.js#L906 - By doing so, the reward lines are taken into consideration and the rule is triggerd by skipping this if clause https://github.com/odoo/odoo/blob/e5c3ba58964f47cfd41d337e39e1bf25eaa25379/addons/pos_loyalty/static/src/js/Loyalty.js#L917-L921 opw-3855323 X-original-commit: ccd16cc
AH-Yussef
force-pushed
the
saas-17.1-16.0-opw-3855323-grant_loyalty_points_for_products_only-alhy-lmMB-fw
branch
from
June 11, 2024 09:03
9259490
to
9dedfdb
Compare
robodoo r+ |
robodoo
pushed a commit
that referenced
this pull request
Jun 12, 2024
Steps to reproduce: - Install POS app. - Go to POS > Products > Discount & Loyalty - Create a New program with: - Program Type: Loyalty Cards - Conditional rules: - Minimum Quantity: 2 - Grant: 1 Loyalty Points per unit paid - Rewards: - Reward Type: Discount - Discount: 100 % one Cheapest Product - In exchange of 2 Loyalty Points - Start a new POS session - Select a Customer - Add two different products. - Notice the Loyalty Points of +2 shown. This is Correct - Click on the Reward button - Notice how the Loyalty Points are now +3 which is obviously wrong given we only have two products. Basically it's as if the reward line (100% discount) is taken into consideration as the cheapest product. Investigation: - Inside `_updatePrograms`, `pointsForPrograms()` are calculated. - we sum the lines quantities regardless of whether it's a reward line or not https://github.com/odoo/odoo/blob/e5c3ba58964f47cfd41d337e39e1bf25eaa25379/addons/pos_loyalty/static/src/js/Loyalty.js#L906 - By doing so, the reward lines are taken into consideration and the rule is triggerd by skipping this if clause https://github.com/odoo/odoo/blob/e5c3ba58964f47cfd41d337e39e1bf25eaa25379/addons/pos_loyalty/static/src/js/Loyalty.js#L917-L921 opw-3855323 closes #166099 X-original-commit: ccd16cc Signed-off-by: Joseph Caburnay (jcb) <jcb@odoo.com>
robodoo
pushed a commit
that referenced
this pull request
Jun 12, 2024
Steps to reproduce: - Install POS app. - Go to POS > Products > Discount & Loyalty - Create a New program with: - Program Type: Loyalty Cards - Conditional rules: - Minimum Quantity: 2 - Grant: 1 Loyalty Points per unit paid - Rewards: - Reward Type: Discount - Discount: 100 % one Cheapest Product - In exchange of 2 Loyalty Points - Start a new POS session - Select a Customer - Add two different products. - Notice the Loyalty Points of +2 shown. This is Correct - Click on the Reward button - Notice how the Loyalty Points are now +3 which is obviously wrong given we only have two products. Basically it's as if the reward line (100% discount) is taken into consideration as the cheapest product. Investigation: - Inside `_updatePrograms`, `pointsForPrograms()` are calculated. - we sum the lines quantities regardless of whether it's a reward line or not https://github.com/odoo/odoo/blob/e5c3ba58964f47cfd41d337e39e1bf25eaa25379/addons/pos_loyalty/static/src/js/Loyalty.js#L906 - By doing so, the reward lines are taken into consideration and the rule is triggerd by skipping this if clause https://github.com/odoo/odoo/blob/e5c3ba58964f47cfd41d337e39e1bf25eaa25379/addons/pos_loyalty/static/src/js/Loyalty.js#L917-L921 opw-3855323 closes #166099 X-original-commit: ccd16cc Signed-off-by: Joseph Caburnay (jcb) <jcb@odoo.com>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Steps to reproduce:
Investigation:
_updatePrograms
,pointsForPrograms()
are calculated.odoo/addons/pos_loyalty/static/src/js/Loyalty.js
Line 906 in e5c3ba5
odoo/addons/pos_loyalty/static/src/js/Loyalty.js
Lines 917 to 921 in e5c3ba5
opw-3855323
Forward-Port-Of: #165833
Forward-Port-Of: #161503