Romain Derie 63131c2584 [FIX] sale_coupon: reset no more eligible applied coupon to Valid state
Before this commit:
When a coupon_program's coupon was giving a reward on a SO and then the
recompute was removing that reward (eg the SO did not met the requirements
anymore) the coupon would not be reset and would be lost.

Now:
If a coupon's reward got removed for some reason, the coupon got reset to a
valid state (`new`) so it can be used again.

Step to reproduce:
  - Generate a coupon from a coupon program that needs requirements (eg $300)
  - Add that coupon to a SO that has a total over $300
  - Coupon is set as `used` and the reward is granted
  - Remove some products to set the SO total below $300
  - Recompute coupon, the reward is correctly removed but the coupon is still
    set as `used` so it won't be usable again and is basically lost.

Closes #3062
2018-11-15 15:57:17 +01:00
S
Description
No description provided
LGPL-3.0
3.4 GiB
Languages
Python 49.6%
JavaScript 47.8%
SCSS 2%
CSS 0.3%
HTML 0.2%