[10.0][FIX] shopinvader_promotion_rule: avoid to call the auto_apply rule twice after applying a coupon code #426
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This ticket aims to avoid double code processing when adding a coupon code.
Add coupon removes and re-applies automatic rules:
https://github.com/OCA/sale-workflow/blob/10.0/sale_promotion_rule/models/sale_promotion_rule.py#L221
https://github.com/OCA/sale-workflow/blob/10.0/sale_promotion_rule/models/sale_promotion_rule.py#L224
So it is not useful to re-call:
https://github.com/shopinvader/odoo-shopinvader/blob/10.0/shopinvader_promotion_rule/services/cart.py#L48
There is no need to add a new test for that. The non-failure of the existing one is enough as we just avoid to call twice the same process.