-
-
Notifications
You must be signed in to change notification settings - Fork 70
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
[16.0] improves loyalty_partner_applicability #265
Open
lmignon
wants to merge
4
commits into
OCA:16.0
Choose a base branch
from
acsone:16.0-improve-loyalty-partner-applicability
base: 16.0
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
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
[16.0] improves loyalty_partner_applicability #265
lmignon
wants to merge
4
commits into
OCA:16.0
from
acsone:16.0-improve-loyalty-partner-applicability
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
lmignon
force-pushed
the
16.0-improve-loyalty-partner-applicability
branch
from
January 27, 2025 13:18
a73a208
to
53c040d
Compare
lmignon
force-pushed
the
16.0-improve-loyalty-partner-applicability
branch
2 times, most recently
from
February 5, 2025 07:40
e6217d0
to
e4fb7c8
Compare
This was referenced Feb 5, 2025
Before this commit, the partner applicability was not working according to the addon description. For programs with multiple rules, rules defined for specific partners were being applied to any partner as long as the partner had a rule defined for them. The same applied to the coupon, where a coupon defined for a specific partner could be used by any partner as long the partner had a ruele defined for them in the same program where the coupon was defined. This commit fixes the issue by ensuring that the partner applicability is only checked for the partner that the rule or coupon is defined for. It's done by removing the rules not applicable to the the partner linked to the sale order when the system is requesting the rules to be applied to the products in the sale order. When a coupon is applied we also checke if the partner is linked to the rule at the origin of the coupon. Or to a rule linked to the loyalty card program.
…alty programs to partners This change introduces a new mixin to allow the definition of the applicability of a loyalty program to a partner. This mixin is used in the loyalty program model to define the applicability of the program to partners. The mixin is also used in the loyalty rule model to define the applicability of the rule to partners. With this change, the applicability of a loyalty program to a partner can be now defined at the program and rule level.
Rename rule_partners_domain to partner_domain on loyalty.rule Since the previous implementation was not correct and defacto defined the applicability of the rule at program level (If a rule was restricted to a partner, all the rules of the program was available to the partner even if the other rules where restricted to other partners), this change add a migration script to aggreate the partner domain of the rules of the program and set it at the program level. The new domain is the OR of the domain of the rules of the program.
…ng loyalty programs to partners The partner applicability of a loyalty rule can now be defined at the level of the loyalty program in addition to the level of the loyalty rule. This commit adapts the module to this new way of defining the partner applicability of a loyalty program when computing the domain to use for the mass mailing of a loyalty program.
lmignon
force-pushed
the
16.0-improve-loyalty-partner-applicability
branch
from
February 5, 2025 08:02
e4fb7c8
to
956ab07
Compare
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
fixes #238