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

Further fix #5989 (Item counter accepts values higher than the available stock) #6658

Merged

Conversation

andrewpbrett
Copy link
Contributor

@andrewpbrett andrewpbrett commented Jan 14, 2021

What? Why?

Closes #5989

In testing that PR, @filipefurtad0 noticed that it was still possible to manually fill in the quantity field and get the undesirable behavior. This prevents that from happening.

What should we test?

See #5989 (comment)

Release notes

Prevent the quantity field in the admin order screen from adding more than the available stock.

Changelog Category: User facing changes

Dependencies

Documentation updates

Copy link
Member

@mkllnk mkllnk left a comment

Choose a reason for hiding this comment

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

Hehe, nice one.

@sauloperez
Copy link
Contributor

sauloperez commented Jan 15, 2021

Please, fill up the release notes section of the description 🙏

@filipefurtad0 filipefurtad0 self-assigned this Jan 21, 2021
@filipefurtad0 filipefurtad0 added the pr-staged-fr staging.coopcircuits.fr label Jan 21, 2021
@filipefurtad0
Copy link
Contributor

filipefurtad0 commented Jan 21, 2021

Hey @andrewpbrett ,

Thank you for this improvement! This now works fine, when editing or creating an order in the same window :

image

Typing a value higher than expected triggers this modal and adjusts the stock levels correctly 👍

Good to go!

PS: Not introduced by this PR - Doing so in different windows breaks the order, if stock is exceeded and payments are added:

error_saving_payment

This causes an "Error saving payment". Clicking on "order details" then shows us our furry friend:

image

Bugsnag:
https://app.bugsnag.com/open-food-france/coopcircuits/errors/600953856321bf0017af66c0?event_id=600953850069a29e800f0000&i=sk&m=nw

I think multi-tab / window is not supported on OFN, but this leads to corrupt orders which then need fixing - opening an issue on this.

@filipefurtad0 filipefurtad0 removed the pr-staged-fr staging.coopcircuits.fr label Jan 21, 2021
@andrewpbrett andrewpbrett merged commit 70f30f5 into openfoodfoundation:master Jan 21, 2021
@andrewpbrett andrewpbrett deleted the item-counter-fix branch January 21, 2021 18:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
4 participants