odoo/odoo#204154
Created by fw-bot
Merged
at eca08439d508b6528bbffd7461346bacca3b17ae
Statuses:
- legal/cla: Contributor License Agreement check
- ci/runbot: Odoo Test Suite
- ci/upgrade_enterprise: Test upgrades for enterprise master
- ci/template: Contact runbot team on discord for help.
- ci/style: Optional style check. Ignore it only if strictly necessary.
- ci/security: Required security check. Can only be ignored by security team.
- label
- odoo-dev:17.0-16.0-opw-4246768-prevent_archiving_products_used_for_discount-sile-425222-fw
- head
- c3a1ac6313bfd7ee9617519509a40a482da1ab75
- merged
- 7 months ago by Bugfix, Levi Siuzdak
| odoo/odoo | |
|---|---|
| 16.0 | #203241 |
| 17.0 | #204154 |
| saas-17.4 | #204175 |
| 18.0 | #204275 |
| saas-18.1 | #204300 |
| saas-18.2 | #204327 |
| saas-18.3 | |
| saas-18.4 | |
| 19.0 | |
| master | #204351 |
[FW][FIX] loyalty: prevent archiving product used for specific discounts
Versions
- 16.0+
Steps
- Create a promotion program;
- add a reward that offers a discount on a specific product;
- specify a specific product;
- archive the specified specific product;
- create a sales order with a random product;
- apply applicable rewards.
Issue
The reward's specific discount has become applicable to all products.
Cause
After archiving a product, the reward's discount_product_ids becomes empty unless active_test=False is added to the context.
With this field empty, and no otherwise specified product domain, the discount can be applied to any product.
Solution
Prevent archiving products that have an active program applying a specific discount to them.
Forward-Port-Of: #203241