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

@robodoo
Copy link
Contributor

robodoo commented Apr 1, 2025

Pull request status dashboard

@fw-bot
Copy link
Contributor Author

fw-bot commented Apr 1, 2025

This PR targets saas-18.1 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

@robodoo robodoo added the forwardport This PR was created by @fw-bot label Apr 1, 2025
@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 #204327 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.

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
@lvsz lvsz force-pushed the saas-18.1-16.0-opw-4246768-prevent_archiving_products_used_for_discount-sile-426897-fw branch from df040a2 to 10af1d0 Compare April 1, 2025 16:05
@lvsz
Copy link
Contributor

lvsz commented Apr 1, 2025

robodoo r+

@fw-bot
Copy link
Contributor Author

fw-bot commented Apr 1, 2025

@lvsz @Demesmaeker this PR was modified / updated and has become a normal PR. It must be merged directly.

robodoo pushed a commit that referenced this pull request 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

closes #204300

X-original-commit: c6a5f01
Signed-off-by: Morgane Demesmaeker <edm@odoo.com>
Signed-off-by: Levi Siuzdak <sile@odoo.com>
@robodoo robodoo closed this Apr 1, 2025
@fw-bot fw-bot deleted the saas-18.1-16.0-opw-4246768-prevent_archiving_products_used_for_discount-sile-426897-fw branch April 8, 2025 21:57
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