You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I debugged the code a little bit and I think I found the bug. Line 389 in #_rule.py checks whether a price rule is coupon_code_based (#_rule.coupon_code_based == 1). If this is the case, it is only checked whether any coupon code is set in the args parameter (args.coupon_code). However, there is no specific check as to whether the coupon code used is actually linked to the price rule.
As a result, all price rules with coupon_code_based == 1 that fulfil the other conditions are applied as soon as a coupon code is entered - regardless of whether this code applies to the respective price rule.
At the beginning of the loop pass via the #_rules, it should be checked whether the #_rule is coupon_code_based. If this is the case, a database query should be used to verify whether this # rule is actually linked to the transferred coupon code. If there is no match, the # rule can be skipped as it is not relevant.
I don't know whether this has side effects that I'm just overlooking. Or is the approach generally wrong?
Btw: I am also on version 14.
Information about bug
Add two # rules & create coupons for the same
Item 1 - Discount 10%
Item 2 - Discount 25%
In sales order add both Item 1 & Item 2. Apply coupon for Item 1, instead of applying only 10%, it applies both # rules in the sales order
Module
selling
Version
Frappe 14
ERP latest
Installation method
None
Relevant log output / Stack trace / Full Error Message.
No response
The text was updated successfully, but these errors were encountered: