Skip to content

Conversation

@fw-bot
Copy link
Contributor

@fw-bot fw-bot commented Apr 1, 2025

Versions

  • 16.0+

Steps

  1. Create a promotion program;
  2. add a reward that offers a discount on a specific product;
  3. specify a specific product;
  4. archive the specified specific product;
  5. create a sales order with a random product;
  6. 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.

opw-4246768

Forward-Port-Of: #204175
Forward-Port-Of: #203241

Versions
--------
- 16.0+

Steps
-----
1. Create a promotion program;
2. add a reward that offers a discount on a specific product;
3. specify a specific product;
4. archive the specified specific product;
5. create a sales order with a random product;
6. 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.

opw-4246768

X-original-commit: c6a5f01
@robodoo
Copy link
Contributor

robodoo commented Apr 1, 2025

Pull request status dashboard

@robodoo robodoo added the forwardport This PR was created by @fw-bot label Apr 1, 2025
@fw-bot
Copy link
Contributor Author

fw-bot commented Apr 1, 2025

This PR targets 18.0 and is part of the forward-port chain. Further PRs will be created up to master.

More info at https://github.com/odoo/odoo/wiki/Mergebot#forward-port

@C3POdoo C3POdoo added the OE the report is linked to a support ticket (opw-...) label Apr 1, 2025
@fw-bot
Copy link
Contributor Author

fw-bot commented Apr 1, 2025

@lvsz @Demesmaeker child PR #204300 was modified / updated and has become a normal PR. This PR (and any of its parents) will need to be merged independently as approvals won't cross.

@lvsz
Copy link
Contributor

lvsz commented Apr 1, 2025

robodoo r+

@robodoo robodoo closed this in 6a196dd Apr 1, 2025
@fw-bot fw-bot deleted the 18.0-16.0-opw-4246768-prevent_archiving_products_used_for_discount-sile-426707-fw branch April 8, 2025 18:45
gamarino pushed a commit to numaes/numa-public-odoo that referenced this pull request Apr 26, 2025
Versions
--------
- 16.0+

Steps
-----
1. Create a promotion program;
2. add a reward that offers a discount on a specific product;
3. specify a specific product;
4. archive the specified specific product;
5. create a sales order with a random product;
6. 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.

opw-4246768

closes odoo/odoo#204275

X-original-commit: c6a5f0139a07bd70e46e0774de6765fdec164bda
Signed-off-by: Morgane Demesmaeker <edm@odoo.com>
Signed-off-by: Levi Siuzdak <sile@odoo.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

forwardport This PR was created by @fw-bot OE the report is linked to a support ticket (opw-...)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants