Skip to content
Snippets Groups Projects
Commit bff53f52 authored by prro-odoo's avatar prro-odoo
Browse files

[FIX] sale_coupon: allow changing reward line quantity


How to reproduce the problem:
- Install the sale_coupon module
- Sales -> Products -> Promotion Programs
- Create a promotion with "Fixed Amount" discount, "Apply on current
order", with Based on Products as "Name = Large Cabinet"
- Create a SO with 3 Large Cabinet.
- Modify the quantity on the new reward line: the price unit became 0.

A client should be able to manually change the discount quantity.
That was not possible before due to the fact that the reward products of
a promotion are saved in the DB with a list price of 0.
As the reward generation handles the job of computing the correct
unit price on a reward SOL, that unit price is simply re-used when
the quantity is changed.

Also corrects the case where a Free Product is different from the
Rule Product(s): with the promotion
"Buy 1 Product A, get 1 free Product B", if the Sale Order has
3 Product A, for example, the promotion will offer only 1 Product B,
while it should offer 3.

opw-2522604

closes odoo/odoo#75143

X-original-commit: 97b78e89
Signed-off-by: default avatarRomain Derie <rdeodoo@users.noreply.github.com>
Signed-off-by: default avatarprro-odoo <proose@users.noreply.github.com>
parent a1f28691
Branches
Tags
No related merge requests found
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment