summaryrefslogtreecommitdiff
path: root/tests/test_program_without_code_operations.py
diff options
context:
space:
mode:
authorRomain Derie <rde@odoo.com>2017-11-27 15:08:47 +0100
committerRomain Derie <rde@odoo.com>2017-11-29 16:23:56 +0100
commitb236ca3f15494957baf96c5eaf3883fd261d959a (patch)
treeba077d52f953012f56a79284fc26f66881ab0094 /tests/test_program_without_code_operations.py
parent16531f6548fb9b1b03215dcfee9922ab5c23e7cf (diff)
[FIX] sale_coupon: incorrect free product qty
Note: The following bugs were also impacting the e-commerce. This commit fixes some bugs related to promotion program offering free product: - Create a promotion program that offers an ipad if you buy 3 of them, so the fourth is free (reduced in total) 1. Buying 4, getting a free one, removing one, free one remains - Create a quotation with 3 ipad, save and update promotions, you don't have a free one, which is 'correct' - Edit, change the qty to 4 ipad, save, update promotions, you have a free ipad (reduced from total), still correct - Edit, change the qty back to 3 ipad, update ptomotions, you still have a free ipad even if you only bought 3 of them (the way it is designed, the free ipad should only appears when you order your fourth). 2. Exponential bug: buy a lot of ipad, get a lot of free ipad then set the qty to a lower amount, you will have a lot more free ipad than you should. It can even lead to a negative amount (more free ipad than you paid ipad, but in that case you won't be able to confirm the sale). - Create a quotation with 100 ipad, you get 31 free ipad (which is incorrect, see bug 3) - Edit and change the qty back to 10 ipad and save - Update promotions, you will have 10 ipad to pay and 10 free ipad resulting in a null total. 3. Buy X ipad, get Y+Z free instead of Y (lets illustrate with 10) - Create a quotation with 10 ipad, you get 3 free ipad instead of 2 - Indeed, your first 4 ipad should give you a free one - Your next 4 ipad should give you a second one (you got 8) - The last 2 (to reach 10) are not enough to give you a third free ipad This is because free products are reward lines in the SO (is_reward_line) but not linked to an applied_coupon_ids Now, these reward lines will be considered as such and the coupon computing will return correct results This closes #1643
Diffstat (limited to 'tests/test_program_without_code_operations.py')
0 files changed, 0 insertions, 0 deletions