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

Fix quantity misadjustment on status change from Canceled to any non-loggable #36123

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from

Conversation

Macin609
Copy link

@Macin609 Macin609 commented May 9, 2024

Questions Answers
Branch? develop
Description? Fixes the stock issue where the physical quantity was incorrectly increased when an order's status changed from a Canceled or Payment error state to any non-loggable state. More details below.
Type? bug fix
Category? CO
BC breaks? no
Deprecations? no
How to test? In description below
UI Tests
Fixed issue or discussion? Fixes #36024
Related PRs
Sponsor company @AvalancheMedia

How to test?

1. Check the stock quantity for a selected product

image

2. Create an order for the selected product

Make sure the order is in a non-loggable state, such as Awaiting Bank Wire Payment. Check the stock quantity for the ordered product.
image

3. Change order status to Canceled or Payment error

Recheck the stock quantity for the ordered product. At this stage everything should be correct, the stock has returned to the state before the order was created.
image

4. Change order status to any non-loggable status for example Awaiting bank wire payment.

Expected behavior:

The amount of stock should return to the same as in the second step.
image

Behavior before bug fix:

The physical quantity was incorrectly increased by the quantity of ordered product.
image

5. Change order status again to Canceled or Payment error

Expected behavior:

The stock quantity should return to the same level as it was in the third step.
image

Behavior before bug fix:

Now you've somehow generated some additional stock :)
image

…loggable

Physical quantity was incorrectly increased when an order's status changed from a Canceled/Payment error state to any non-loggable state. The added condition correctly decreases the physical quantity of the affected products.
@Macin609 Macin609 requested a review from a team as a code owner May 9, 2024 18:20
@prestonBot
Copy link
Collaborator

Hello @Macin609!

This is your first pull request on the PrestaShop project. Thank you, and welcome to this Open Source community!

@prestonBot prestonBot added develop Branch Bug fix Type: Bug fix labels May 9, 2024
Copy link
Contributor

@matthieu-rolland matthieu-rolland left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

looks good to me 👍

I launched UI tests on your PR just in case: https://github.com/matthieu-rolland/ga.tests.ui.pr/actions/runs/9066041693

@PrestaShop PrestaShop deleted a comment from prestonBot May 13, 2024
@matthieu-rolland
Copy link
Contributor

Re-ran failed job on both ui tests and CI

@kpodemski kpodemski added the Waiting for QA Status: action required, waiting for test feedback label May 15, 2024
@paulnoelcholot
Copy link

@paulnoelcholot paulnoelcholot added the Waiting for author Status: action required, waiting for author feedback label May 15, 2024
@matthieu-rolland
Copy link
Contributor

FYI : @Macin609 CI failed : paulnoelcholot/testing_pr/actions/runs/9095288456

I think if you re-run the failed test it will work, I ran it too and it's all green for me: https://github.com/matthieu-rolland/ga.tests.ui.pr/actions/runs/9066041693

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug fix Type: Bug fix develop Branch Waiting for author Status: action required, waiting for author feedback Waiting for QA Status: action required, waiting for test feedback
Projects
Status: Waiting for author
Development

Successfully merging this pull request may close these issues.

Prestashop 8.x: Incorrect Increase in Physical Quantity when Order Status Changes
6 participants