-
-
Notifications
You must be signed in to change notification settings - Fork 63
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
[14.0][FIX] sale_promotion_discount_in_field #146
[14.0][FIX] sale_promotion_discount_in_field #146
Conversation
6694cf8
to
fa9fb19
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.
Please fix comments.
program = self.env["coupon.program"].search(program_domain) | ||
if ( | ||
program | ||
and program.reward_type == "discount_line" |
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.
I think this conditions need add in search domain on the 15th code lines.
Then like this:
if program:
...
return error_status
return super().apply_coupon(order, coupon_code)
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.
resolved
|
||
def apply_coupon(self, order, coupon_code): | ||
# OVERRIDE to apply the program to the order without reward lines | ||
error_status = {} |
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.
I think this variable not need set because error_status use, if program is exists.
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.
resolved
2475.0, | ||
"The order total with programs should be 2475.00", | ||
) | ||
self.assertEqual(result, {}) |
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.
Doesn't have message for assertion.
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.
resolved
error_status = {} | ||
program_domain = order._get_coupon_program_domain() | ||
program_domain = expression.AND( | ||
[program_domain, [("promo_code", "=", coupon_code)]] |
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.
Please change domain like this.
program_domain = expression.AND(
[program_domain, [("promo_code", "=", coupon_code), ("reward_type", "=", "discount_line"), ("promo_applicability", "!=", "on_next_order")]]
)
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.
resolved
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.
Functional OK!
Before this PR, "max customer applications" from sale_coupon_limit could be bypassed with reward type = discount in line
@chienandalu good for you?
This PR has the |
when Promo code used, promotion was not added to Applied Promo Program of current order.
17169c0
to
9cea208
Compare
@pedrobaeza merge please? |
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.
/ocabot merge patch
@@ -0,0 +1 @@ | |||
"This module should be renamed sale_coupon_discount_in_field in future migrations for naming consistency." |
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.
Or loyalty in 16+...
What a great day to merge this nice PR. Let's do it! |
On my way to merge this fine PR! |
Congratulations, your PR was merged at d5df43a. Thanks a lot for contributing to OCA. ❤️ |
when Promo code used, promotion was not added to Applied Promo Program of current order.