-
- Downloads
[FIX] sale_coupon: fix the unexpired_promotions filter
Expected behaviour When having multiple promotions with, for example, a promotion of X% for the first order and a promotion of Y% (Y<X), we should apply the first promotion on the first order and then don't get this promotion into account to choose the best promotion for a future order, so that we have: 1. A promotion of X% on the first order 2. A promotion of Y% on every other order Observed behaviour When trying to apply promotion on other order, nothing seems to happen, as Odoo take the already-used X% promotion into account, being the most interesting promotion, select it as the best promotion to apply and then apply it to finally get a result of a 0% discount as the promotion has already been used. Problem Root Cause As it can be seen in the commit, the error comes from the fact we filtered the available promotion with a non-strict inequality. Validation A test has been added in test_program_numbers.py to validate our fix Related issue - opw-2674681 closes odoo/odoo#81308 X-original-commit: d2c58a9d Signed-off-by:Romain Derie (rde) <rde@odoo.com> Signed-off-by:
Hendrickx Anthony (anhe) <anhe@odoo.com>
Loading
Please register or sign in to comment