Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[10.0][FIX] shopinvader_promotion_rule: avoid to call the auto_apply rule twice after applying a coupon code #426

Merged
merged 1 commit into from
Sep 25, 2019

Conversation

Cedric-Pigeon
Copy link

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.

@codecov-io
Copy link

Codecov Report

Merging #426 into 10.0 will increase coverage by <.01%.
The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff             @@
##             10.0     #426      +/-   ##
==========================================
+ Coverage   89.29%   89.29%   +<.01%     
==========================================
  Files         135      135              
  Lines        3511     3512       +1     
==========================================
+ Hits         3135     3136       +1     
  Misses        376      376
Impacted Files Coverage Δ
shopinvader_promotion_rule/services/cart.py 98.27% <100%> (+0.03%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 1e23833...f4cb746. Read the comment docs.

@lmignon
Copy link
Collaborator

lmignon commented Sep 25, 2019

/ocabot merge patch

@shopinvader-git-bot
Copy link

On my way to merge this fine PR!
Prepared branch 10.0-ocabot-merge-pr-426-by-lmignon-bump-patch, awaiting test results.

shopinvader-git-bot pushed a commit that referenced this pull request Sep 25, 2019
Signed-off-by lmignon
@lmignon lmignon mentioned this pull request Sep 25, 2019
77 tasks
@shopinvader-git-bot shopinvader-git-bot merged commit f4cb746 into shopinvader:10.0 Sep 25, 2019
@shopinvader-git-bot
Copy link

Congratulations, your PR was merged at 5457c7e. Thanks a lot for contributing to shopinvader. ❤️

@lmignon lmignon deleted the 10.0-promo-cpi branch September 25, 2019 15:23
This was referenced Aug 31, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants