-
Notifications
You must be signed in to change notification settings - Fork 23.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[FIX] pos_restaurant: Grant loyalty points for products only
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>
- Loading branch information
Showing
3 changed files
with
78 additions
and
1 deletion.
There are no files selected for viewing
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 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 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