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 #162268
[FW][FIX] pos_restaurant: Grant loyalty points for products only #162268
Conversation
@AH-Yussef @caburj cherrypicking of pull request #161503 failed. stdout:
stderr:
Either perform the forward-port manually (and push to this branch, proceeding as usual) or close this PR (maybe?). In the former case, you may want to edit this PR message as well. More info at https://github.com/odoo/odoo/wiki/Mergebot#forward-port |
8fb0888
to
2de0bc4
Compare
ae10b3a
to
2aa0900
Compare
addons/pos_loyalty/static/src/tours/PosLoyaltyLoyaltyProgramTour.js
Outdated
Show resolved
Hide resolved
addons/pos_loyalty/static/src/tours/PosLoyaltyLoyaltyProgramTour.js
Outdated
Show resolved
Hide resolved
addons/pos_loyalty/static/src/tours/PosLoyaltyLoyaltyProgramTour.js
Outdated
Show resolved
Hide resolved
2aa0900
to
31d9199
Compare
Looks like you are missing a step. A dialog is still displayed and you might need to select the reward. |
e29e2b2
to
bd3edab
Compare
bd3edab
to
371d04e
Compare
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: 6336e45
371d04e
to
dcfc022
Compare
@robodoo r+ |
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 #162268 X-original-commit: 6336e45 Signed-off-by: Joseph Caburnay (jcb) <jcb@odoo.com> Signed-off-by: Ali Hassan Youssef (alhy) <alhy@odoo.com>
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: #161503