diff options
| author | Romain Derie <rde@odoo.com> | 2018-11-09 14:13:01 +0100 |
|---|---|---|
| committer | Romain Derie <rde@odoo.com> | 2018-11-15 15:56:19 +0100 |
| commit | 7b99c0db92e42b712104abc7147eb9ed807ceb2f (patch) | |
| tree | 97e0b00e31bbdf83e2fcec006aa7c65eb9b706e5 /tests/test_program_with_code_operations.py | |
| parent | 51c7afff48871335a79af849d16bbaea15454e0e (diff) | |
[FIX] sale_coupon: generate only one coupon per program per SO
Before this commit:
Everytime the SO met a 'on_next_order' program requirements, a coupon would be
generated on that SO. Even if there was already a coupon for that program set to
'expired', for instance when the SO did not met the requirements anymore.
Now:
When the requirements are met, it checks that an `expired` coupon does not
already exist.
It it does, it will set that coupon back to `reserved` state.
Step to reproduce:
- Create a program on `next_order` with requirements, eg $300 amount
- Create a SO and add $300 worth of products
- Update promotion, a coupon is created and set to `reserved`
- Now update the SO to go below $300
- Update promotion, the coupon is set to `expired` as it should
- Update again the SO to meet the $300 requirements again
- Update promotion, a new `reserved` coupon is generated instead of updating
the state of the previous one from `expired` to `reserved`
Closes #3062
Diffstat (limited to 'tests/test_program_with_code_operations.py')
0 files changed, 0 insertions, 0 deletions
